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?
erikcookAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

dgroscostCommented:
Try using:

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

or

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

0
erikcookAuthor Commented:
I tried this one as well.

start /wait produces an invalid switch error message.
0
erikcookAuthor Commented:
Might seem backwards, but


start /wait produces bad switch error and
start command /wait  kills the process after winzip extracts
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

dgroscostCommented:
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 ?

0
erikcookAuthor Commented:
Please read above.

start /wait produces "bad switch" error and
start command.exe /wait  kills the process after winzip extracts

./ indicating current directory
0
dgroscostCommented:
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...

0
Netman66Commented:
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.

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

0
erikcookAuthor Commented:
Yes.
0
dgroscostCommented:
You could use Windows Scripting and create a .WSH file...

Try something along the lines of this...
Replace notepad with the NetOp filename.

<package>
      <job id="vbs">
            <script language="VBScript">
                  set WshShell = WScript.CreateObject("WScript.Shell")
                                                Return = WshShell.Run("C:\path\notepad.exe")
                  WScript.Sleep 180
            </script>
      </job>
</package>


Put that in a file, and run <filename>.wsh -- you'll need Windows Scripting but I believe Win2000 provides that.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
oBdACommented:
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.
0
dgroscostCommented:
Did that work out for you?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows 2000

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.