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!

Hide window with exec function

Status
Not open for further replies.

twooly

MIS
Feb 22, 2004
122
US
Is it possible to hide the window when you do an exec command.

Example:

sping="ping -w 1000 " & strComputer
set wshshell=createobject("wscript.shell")
set oExec=wshshell.exec(sping)
do while oExec.status=0 : wscript.sleep 100 : loop

When the command runs to ping a dos window pops open. Can I hide that?

Thanks
 
Hello twooly,

If you want to specify windows style, you have to use .run. This will hide the cmdprompt window.
Code:
stdoutfile="d:\test\abc.txt"
wshshell.run "%comspec% /c " & sping & " > " & stdoutfile, 0, true
regards - tsuji
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top