Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: shell command return status


Message #1 by jleung@m... on Fri, 7 Sep 2001 10:25:28 -0500
Ordinarily I would advise you to use the Run method of the windows shell
object (in wshom.ocx) with a WaitOnReturn value of True--that forces VB to
wait until the shell command finishes executing & spits out whatever code
the shelled executable returns.

But I'm guessing that you can't really wait for this command to finish
executing--right?  In that case, maybe you can pipe or redirect the output
of shutdown.exe to a text file that you can come back to later?

HTH,

-Roy

-----Original Message-----
From: jleung@m... [mailto:jleung@m...]
Sent: Friday, September 07, 2001 8:25 AM
To: professional vb
Subject: [pro_vb] shell command return status


Hi,

The following line can shutdown a PC within a vb application, does anyone
know how to get a return code to check if the
following command has carry out successful/has failed?

Shell ("command.com /c shutdown \\computername /r /t:30 /y /c"), vbHide

J



  Return to Index