G
Guest
I am looking for a way to shut down the computer (running Windows XP Home) by
script or command. It is important that the script or command completely
turn off the computer since it's a laptop and has no separate switch for the
screen.
The following command will shut down the hard drive, but it doesn't work
well on a laptop because the screen doesn't turn off until the power button
is pressed.
%windir%\System32\shutdown.exe -s -t 00
This calls up the box, but doesn't go any further.
Set objShell = CreateObject("Shell.Application")
objShell.ShutdownWindows
A "SendKeys" statement can be used to elect the "Turn Off" option. This
usually works, but the "SendKeys" command is rather unreliable in this usage
and sometimes fails.
Set WshShell = WScript.CreateObject("WScript.Shell")
Set objShell = CreateObject("Shell.Application")
objShell.ShutdownWindows
WScript.Sleep 200
WshShell.SendKeys "U"
Is there another paramater to elect the "Turn Off" option for the command...
objShell.ShutdownWindows
....or, is there a DLL for shutting down like this one used to hibernate?
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run("%windir%\System32\rundll32.exe Powrprof.dll,SetSuspendState")
Any help would be appreciated.
Thanks,
DJ1
script or command. It is important that the script or command completely
turn off the computer since it's a laptop and has no separate switch for the
screen.
The following command will shut down the hard drive, but it doesn't work
well on a laptop because the screen doesn't turn off until the power button
is pressed.
%windir%\System32\shutdown.exe -s -t 00
This calls up the box, but doesn't go any further.
Set objShell = CreateObject("Shell.Application")
objShell.ShutdownWindows
A "SendKeys" statement can be used to elect the "Turn Off" option. This
usually works, but the "SendKeys" command is rather unreliable in this usage
and sometimes fails.
Set WshShell = WScript.CreateObject("WScript.Shell")
Set objShell = CreateObject("Shell.Application")
objShell.ShutdownWindows
WScript.Sleep 200
WshShell.SendKeys "U"
Is there another paramater to elect the "Turn Off" option for the command...
objShell.ShutdownWindows
....or, is there a DLL for shutting down like this one used to hibernate?
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run("%windir%\System32\rundll32.exe Powrprof.dll,SetSuspendState")
Any help would be appreciated.
Thanks,
DJ1