Link to home
Start Free TrialLog in
Avatar of erikcook
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\addusers.exe /c .\INSTALL-DATA\Domain\AddToGroup.txt
ECHO.
ECHO.
ECHO Installing Netop for Domain Users.
ECHO Please Wait...
.\INSTALL-DATA\Domain\Netop-Domain.exe
.\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?
Avatar of dgroscost
dgroscost

Try using:

%SYSTEMROOT%\SYSTEM32\CMD.EXE /C START /WAIT .\INSTALL-DATA\Domain\Netop-Domain.exe

or

START /WAIT .\INSTALL-DATA\Domain\Netop-Domain.exe

Avatar of erikcook

ASKER

I tried this one as well.

start /wait produces an invalid switch error message.
Might seem backwards, but


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.exe ?

Please read above.

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...

Avatar of Netman66
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.

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?
I guess my first question is, does the NetOp-Domain actually complete the installation on the SP1 machine??  (manual run)

Yes.
ASKER CERTIFIED SOLUTION
Avatar of dgroscost
dgroscost

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
Did that work out for you?