1.

Solve : Batch file start executable problem?

Answer»

Hi,

I am trying to get a batch file to run several installation programs; the idea is that it waits until the setup is completed then RUNS the next one. However, I’ve hit a stumbling block on running just the first installer file. I am pretty sure its something to do with the SPACES, or that it’s a UNC path. I get an error “WINDOWS cannot find appsetup.exe”.

Code: [Select]SET THISDIR="\\server\development\new installation\"
start /wait %THISDIR%appsetup.exe
echo done
pause
I tried this alternative, which didn’t work either. This one produced two DOS windows, one asking me if I want to terminate the job.

Code: [Select]start /wait "\\server\development\new installation\appsetup.exe"
echo done
pause
Neither works… can anyone HELP, please?
try this - START needs a title string for the window, but a null string (two quotes) will do.

start /wait "" "\\server\development\new installation\appsetup.exe"

Code: [Select]C:\>start /?
Starts a separate window to run a SPECIFIED program or command.

START ["title"] [/D path] [/I] [/MIN] [/MAX] [/SEPARATE | /SHARED]
[/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL]
[/AFFINITY <hex affinity>] [/WAIT] [/B] [command/program]
[parameters]

"title" Title to display in window title bar.
path Starting directory.
B Start application without creating a new window. The
application has ^C handling ignored. Unless the application
enables ^C processing, ^Break is the only way to interrupt
the application.
I The new environment will be the original environment passed
to the cmd.exe and not the current environment.
MIN Start window minimized.
MAX Start window maximized.
SEPARATE Start 16-bit Windows program in separate memory space.
SHARED Start 16-bit Windows program in shared memory space.
LOW Start application in the IDLE priority class.
NORMAL Start application in the NORMAL priority class.
HIGH Start application in the HIGH priority class.
REALTIME Start application in the REALTIME priority class.
ABOVENORMAL Start application in the ABOVENORMAL priority class.
BELOWNORMAL Start application in the BELOWNORMAL priority class.
AFFINITY The new application will have the specified processor
affinity mask, expressed as a hexadecimal number.
WAIT Start application and wait for it to terminate.
command/program
If it is an internal cmd command or a batch file then
the command processor is run with the /K switch to cmd.exe.
This means that the window will remain after the command
has been run.

If it is not an internal cmd command or batch file then
it is a program and will run as either a windowed application
or a console application.

parameters These are the parameters passed to the command/program.



Discussion

No Comment Found