![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | find the current stat and reboot I would like to reboot some computer, but I need to know what state there in. Example if computername is in the login prompt rebbot, if computer is locked do nothing. |
My System Specs![]() |
| | #2 (permalink) |
| | RE: find the current stat and reboot hey as i can see it you can make any kind of decision if user login or not so it something like this will do the job: strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" _ & strComputer & "\root\cimv2") Set colComputer = objWMIService.ExecQuery _ ( "Select * from Win32_ComputerSystem" ) For Each objComputer In colComputer If objComputer.UserName = "" ' no user log on strRestart = "shutdown -r -t 0 " Set objShell = CreateObject("WScript.Shell") objShell.Run strRestart Else WScript.Quit Next |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Find my current drive letter and execute a program from it while i | VB Script | |||
| Cannot reboot after bcdedit.exe /set {current} nx AlwaysOff command | Vista General | |||
| reboot vista and can't find os and hard drive | Vista account administration | |||
| find current boot configuration | Vista General | |||
| Vista reboot can't find OS after a application crash | Vista General | |||