Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Restart 64bit TS Server

Status
Not open for further replies.

Mutlyhehe

Technical User
May 21, 2010
5
GB
Hey

Im looking for a way to restart a 64bit TS server autmatically each night, seen the scripts for the 32bit versions but as there is no Shutdown.exe in C:\WINDOWS\SysWOW64 im a bit stuck

Any help is welcome

Thanks
 
Why are you looking in SysWOW64 instead of System32 ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I was told thats where is was lol as its 64bit, looked in sys32 and its there.

Do you know a script that works?
 
What have YOU tried so far and where in your code are you stuck ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Had alook on here and found some code

strComputer = "TS6402"
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate,(Shutdown/r)}"

Set colOperatingSystems = objWMIService.ExecQuery _
("Select * from Win32_OperatingSystem")

For Each objOperatingSystem in colOperatingSystems
objOperatingSystem.Reboot()
Next

But when run this just displays the text in the batch file...

I am new to this so go easy lol

 
>Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate,(Shutdown/r)}"

Where do you find {Shutdown/r}? Never heard of anything like /r. Also strComputer should appear somewhere in that line too. Check your source see if you can uncover that.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top