command line option to shut down/log off

  • Thread starter Thread starter oni
  • Start date Start date
O

oni

hi all,

what is the command line option to shutdown/log off from a
particular profile in win2k.

any help in this regard highy appereciated.

thanks in advance.
 
There's a shutdown exectuable in the resource kit, and there are a number of
them available as freeware. Do a Google search to find one. Shutdown is
included in XP but not 2K.

Alternatively using WMI and a VBS script:

'Shutdown.vbs
set osSet = GetObject("winmgmts:").InstancesOf("Win32_OperatingSystem")
for each os in osSet
os.Win32Shutdown 1
' coment the above and uncoment the below for forced shutdown
' os.Win32Shutdown 5
next

Other values depending on exactly waht you want to do:
(use 0or 4 for logoff)
0 Log Off
0 + 4 Forced Log Off
1 Shutdown
1 + 4 Forced Shutdown
2 Reboot
2 + 4 Forced Reboot
8 Power Off
8 + 4 Forced Power Off
 
Back
Top