erikcook
asked on
Another Batch /wait Question.
I have looked around these forums for a while no and have not seen a solid reliable way to get a batch file to wait for an Win32 application to complete its setup before continuing.
For those who have used sleep.exe; This is where my batch craps out..
cls
ECHO Applying Security Settings for Domain PC's
ECHO Please Wait...
call .\INSTALL-DATA\Domain\addu sers.exe /c .\INSTALL-DATA\Domain\AddT oGroup.txt
ECHO.
ECHO.
ECHO Installing Netop for Domain Users.
ECHO Please Wait...
.\INSTALL-DATA\Domain\Neto p-Domain.e xe
.\INSTALL-DATA\sleep\sleep .exe 180
ECHO.
ECHO.
ECHO.
ECHO Installing Symantec Antivirus.
ECHO Please Wait...
.\INSTALL-DATA\setup.exe
.\INSTALL-DATA\sleep\sleep .exe 180
ECHO.
ECHO.
ECHO.
When the netop-domain.exe runs the winzip expands the files but then dies instantly when the sleep.exe program executes. The sleep app does its job and sits for 3 minutes but you can watch in task manager and the netop-domain.exe is not running.
I need suggestions for this and please do not post unless you have experience with this issue.
Also, I know Call commands will wait on scripts to finish, but they do not work with Win32 apps. Might there be a way to Call a .VBS and is there a VBS script that will execute the dos command and wait for it to finish? Will the batch wait on the vbs to complete?
For those who have used sleep.exe; This is where my batch craps out..
cls
ECHO Applying Security Settings for Domain PC's
ECHO Please Wait...
call .\INSTALL-DATA\Domain\addu
ECHO.
ECHO.
ECHO Installing Netop for Domain Users.
ECHO Please Wait...
.\INSTALL-DATA\Domain\Neto
.\INSTALL-DATA\sleep\sleep
ECHO.
ECHO.
ECHO.
ECHO Installing Symantec Antivirus.
ECHO Please Wait...
.\INSTALL-DATA\setup.exe
.\INSTALL-DATA\sleep\sleep
ECHO.
ECHO.
ECHO.
When the netop-domain.exe runs the winzip expands the files but then dies instantly when the sleep.exe program executes. The sleep app does its job and sits for 3 minutes but you can watch in task manager and the netop-domain.exe is not running.
I need suggestions for this and please do not post unless you have experience with this issue.
Also, I know Call commands will wait on scripts to finish, but they do not work with Win32 apps. Might there be a way to Call a .VBS and is there a VBS script that will execute the dos command and wait for it to finish? Will the batch wait on the vbs to complete?
ASKER
I tried this one as well.
start /wait produces an invalid switch error message.
start /wait produces an invalid switch error message.
ASKER
Might seem backwards, but
start /wait produces bad switch error and
start command /wait kills the process after winzip extracts
start /wait produces bad switch error and
start command /wait kills the process after winzip extracts
Invalid error?
What is this netop program? Can you run it manually?
Why are you using .\ in front of the EXE name?
Can you try START /WAIT C:\blahblah\NetOp-Domain.e xe ?
What is this netop program? Can you run it manually?
Why are you using .\ in front of the EXE name?
Can you try START /WAIT C:\blahblah\NetOp-Domain.e
ASKER
Please read above.
start /wait produces "bad switch" error and
start command.exe /wait kills the process after winzip extracts
./ indicating current directory
start /wait produces "bad switch" error and
start command.exe /wait kills the process after winzip extracts
./ indicating current directory
I've never had such issues (with /start) and I've automated everything underneith the sun.
What is this NetOp-Domain program? Something you or your company has written? Perhaps we can look into what that program is doing and find another way...
What is this NetOp-Domain program? Something you or your company has written? Perhaps we can look into what that program is doing and find another way...
Well, my 2 cents..
Batch commands are running from a 16-bit emulation - I've never had any luck trying to get these things to wait.
Are you comfortable running these commands from VBS? VB Script will wait properly, but I am not a skilled programmer to lend you the answer. Maybe another Expert that is experieinced at VB could jump in here.
Batch commands are running from a 16-bit emulation - I've never had any luck trying to get these things to wait.
Are you comfortable running these commands from VBS? VB Script will wait properly, but I am not a skilled programmer to lend you the answer. Maybe another Expert that is experieinced at VB could jump in here.
ASKER
Its a winzip self extractor that extracts the data from the exe into a temp directory and launches a silent install.
Here is something that might help with my question.
I setup a small batch as a test with just the following in it.
START /WAIT C:\Netop-Domain.exe
PAUSE
I ran this batch on 2 different machines. 1 Windows 2000 SP4 and (2) Windows 2000 SP1
It works on the SP4 machine but not the SP1 machine.
This script must be run on SP1 machines. Is there possibly some kind of registry hack you can do via batch that fixes this problem?
Here is something that might help with my question.
I setup a small batch as a test with just the following in it.
START /WAIT C:\Netop-Domain.exe
PAUSE
I ran this batch on 2 different machines. 1 Windows 2000 SP4 and (2) Windows 2000 SP1
It works on the SP4 machine but not the SP1 machine.
This script must be run on SP1 machines. Is there possibly some kind of registry hack you can do via batch that fixes this problem?
I guess my first question is, does the NetOp-Domain actually complete the installation on the SP1 machine?? (manual run)
ASKER
Yes.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Try
start "NetOp Installation" /wait C:\Netop-Domain.exe
According to the help, the "Title" argument is optional, but it actually isn't; it especially isn't when you use quotes around the program name.
start "NetOp Installation" /wait C:\Netop-Domain.exe
According to the help, the "Title" argument is optional, but it actually isn't; it especially isn't when you use quotes around the program name.
Did that work out for you?
%SYSTEMROOT%\SYSTEM32\CMD.
or
START /WAIT .\INSTALL-DATA\Domain\Neto