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