Re: Win32Shutdown method

From: Soo Kuan Teo [MS] (sookuant_at_online.microsoft.com)
Date: 02/25/04


Date: Tue, 24 Feb 2004 16:00:11 -0800

The following vb script may work for you:
Set OpSysSet =
GetObject("winmgmts:{(RemoteShutdown)}//REMOTE_SYSTEM_NAME/root/cimv2").Exec
Query("select * from Win32_OperatingSystem where Primary=true")

for each OpSys in OpSysSet
 OpSys.Shutdown()
next

you can also try command line TSShutdn.exe /server:Servername /POWERDOWN
/now.

thanks
Soo Kuan

-- 
This posting is provided "AS IS" with no warranties, and confers no rights
"Han Log" <aaa@aaa.com> wrote in message
news:eiR8mgu#DHA.1452@TK2MSFTNGP09.phx.gbl...
> Hi,
>
> I'm use System.Management classes for invoke the Win32Shutdown method (via
> InvokeMethod).
> I pass the 8+4 argument because I want to power off the computer.
>
> All works fine but the problem is when I use the same code on a windows
> service.
> If nobody has been logon, the result is a blank screen instead power off
the
> computer.
> (the initial login screen for Windows XP Pro dissapear)
>
> When press Ctrl+Alt+Supr a validation form appear over the blank screen.
>
> My question is if it's possible to power off the computer (programaticaly)
> without nobody logon.
>
> Thank you
>
>


Relevant Pages

  • Win32Shutdown method
    ... I'm use System.Management classes for invoke the Win32Shutdown method (via ... I pass the 8+4 argument because I want to power off the computer. ... All works fine but the problem is when I use the same code on a windows ... without nobody logon. ...
    (microsoft.public.windowsxp.wmi)
  • Re: Win32Shutdown method
    ... The Shutdown method not power off the computer. ... >> without nobody logon. ...
    (microsoft.public.windowsxp.wmi)