Solved

How do I write a script with a timer to reboot XP and 2K workstations?

Posted on 2009-04-07
5
594 Views
Last Modified: 2012-05-06
Hi Folks,

I'm a newbie to the world of Scripting. I will presume VBScript is able to restart systems as I have come across a few simple scripts to do that.

I will like to create a script to be pushed from SMS to do a mandatory restart of W2K and XP workstations. There should be a prompt telling the user to save all their files and restart now or it will restart automatically in 90mins.

- If the user click restart now, there will be another prompt to inform user to save their files before clicking on the restart button.
- If the user click restart in 90mins, there will  be a pop up timer to show how many minutes more before restart.

Any advice is greatly appreciated.

Thanks
Derek
0
Comment
Question by:Decarn
  • 2
  • 2
5 Comments
 
LVL 14

Expert Comment

by:yehudaha
Comment Utility
0
 

Author Comment

by:Decarn
Comment Utility
Hi yehudaha,

PsShutdown is a utility and I have to insert the computer names in. As I already have SMS with the collection of all the computers, I'm looking at how I can push down a single script to restart all these systems without the need for any third party software.

0
 
LVL 67

Expert Comment

by:sirbounty
Comment Utility
most newer operating systems include shutdown.exe
Not sure if that would meet your needs or not?
We add a custom app to our sms packages that shutdown the pc after verifying some things using this:

shutdown -s -t 10 -f
0
 

Author Comment

by:Decarn
Comment Utility
Hi sirbounty,

shutdown command does not exist for WIN2K. My environment has both W2K and XP system.
0
 
LVL 67

Accepted Solution

by:
sirbounty earned 100 total points
Comment Utility
Then use this method:

C:\Windows\Rundll32.exe shell32.dll,SHExitWindowsEx 0x2

outlined at http://www.trap17.com/index.php/automated-restarts-shutdown_t20408.html
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Hello again, all.  For those of you that have been following along, you'll know that this is my third article on this topic (though it is not Part III).  This article is sort of remedial, and probably the topic with which I should have started the s…
Introduction During my participation as a VBScript contributor at Experts Exchange, one of the most common questions I come across is this: "I have a script that runs against only one computer. How can I make it run against a list of computers in …
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now