JIM.H. said:
Hello, thanks for the reply.
When I use START I have to use EXIT in the batch file so
that windows will close, do I have to user EXIT if I use
ShellExecute.exe? Also with START /I I am expecting the
called batch file should have the variables I defined with
SET command in the calling batch file, am I wrong?
Thanks,
Jim.
Instead of calling the batch file directly, you can call the command
interpreter (CMD.EXE) and then specify exactly what you want to happen to
the window when it is finished. Cmd.exe will accept /C to close or /K to
keep the window open:
Start Cmd.exe /C x:\path\childscript.bat
Start Cmd.exe /K x:\path\childscript.bat
When called by ShellExecute.exe the window will be hidden, but the process
will automatically close without calling EXIT:
Start ShellExecute.exe /f:x:\path\childscript.bat /r:hidden
The /I switch does the opposite of what I think you want. By default if you
change some variables in one batch file they will be available in the child
process, so don't specify /I.