ok, I havent done this since I was like 15 but need this done for work.
what I’m trying to do is create a batch file that’ll take a file, rename it to something else, then run an EXE, then once the EXE is closed, rename said file back to what it was originally.
it renames said files ok without any problems, but it doesnt want to run ugraf.exe. I remember back when I used to do this, windows at the time didn’t support long file names, so I’d have to use below instead for Program Files
this didn’t seem to work either… keeps telling me that
“windows cannot find *. Make sure you typed the name correctly, and then try again. To search for a file, click the start button, and then click search”
I’m 100% sure that this is where the exe is located. Am I missing something? Is it because of the 3.0 in the folder names?
also, This is going to have to change a file that’s in the c:\windows folder which none of our users have access to modify. I assume, under my admin account, I can just set the permissions for users to access this folder? or even better, can I just set the file to let users modify it?
you dont need to use “start”
your machine is trying to run a program named “start”
[/quote]
that’s how I first had it, then upon a google search it was reccomended adding “start” (it just tells the computer that you want to start a windows executible). Either way, it gives me the same error
are you copying exactly what the tab completion gives you?
I forgot how I used to do it, but I remember back when I used to have to setup the ol autoexec.bat there was a command to set filepaths into memory so you didn’t need to psysically NEED to be in that directory to launch the command.
I figure I could do that to the c:\progra~1\UGS folder and then just go “START Ugraf.exe”
It will work. I do this all the time to syncshell the winzip command line program to make encrypted data backups. The only thing I’m not sure about is if your batch file will wait for ugraf.exe to complete execution before moving to the next line. You may have to add a pause in there.
And sure enough, the batch file does pause until I close notepad. While notepad is open, the txt file is “test2.txt”. As soon as I close it the batch file renames it “test1.txt”.
thats good to know… maybe I should have it launch an independant batch file opposed to just the one in case the batch is closed before the program is (so to prevent something goofy happening as the file I’m renaming is an INI in the windows folder depending on which version of said software the user is launching)
lol I’m having flashbacks to christmas of 95 when I got my first q-basic book
lol same… used to fuck with the librarians computers in school
REM CADRA SELECT MENU @echo off
cls
ECHO CADRA v10.4.0/CADRA 2006 PLUS SELECT MENU
ECHO *
ECHO *
ECHO VERY IMPORTANT, PLEASE DO NOT CLOSE THIS WINDOW AT ANY TIME
ECHO *
ECHO *
ECHO *
PAUSE
cls
echo Please Choose An Option
echo;
echo (1) Run CADRA v.10.0.4
echo (2) Run CADRA v2006 PLUS
echo;
set /p userinp=choose a number(1-2):
set userinp=%userinp:~0,1%
if “%userinp%”==“2” goto 20
if “%userinp%”==“1” goto 10
:10
ren m:\batch est1.txt test2.txt
“C:\Program files\UGS\NX 3.0\UGII\ugraf.exe”
ren m:\batch est2.txt test1.txt
goto end
:20
ren m:\batch\alt1.txt alt2.txt
“C:\Program files\UGS\NX 3.0\UGII\ugraf.exe”
ren m:\batch\alt2.txt alt1.txt
goto end
:end
exit
coming along nicely… supprised that the “choice” command no longer exists though
now that I have the template, just need to apply it to the real world and tweak it