Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Wscript hangs when running command 1

Status
Not open for further replies.

vnad

MIS
Nov 22, 2002
91
US
I am running a pretty simple command through VBscript

Set oShell = CreateObject("Wscript.Shell")
commandRun = "cmd /k WZZIP " & destinationFolderPath & sDate & " " & destinationFolderPath & "dn*"
set OutputValue = oShell.Exec (commandRun)

Do while (outputValue.Status <> 2)
wscript.sleep(1000)
loop

This code hangs the cmd window and the zip never completes. I am running the command line addon for winzip 9.0.

I just want to wait until the zip is complete to move the new zip file.

Any ideas or workarounds?
 
Have you tried to replace /k by /c ?
In addition you may use the Run method with 3rd parameter (bWaitOnReturn) set to True ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
You are my hero. I tried using the run command but did not know about the variables. Thanks.. works great now.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top