?
Solved

VBS Script to Shutdown Computers

Posted on 2011-10-15
7
Medium Priority
?
574 Views
Last Modified: 2012-06-27
Hey everyone,

I know this exists because I’ve seen different forms of it but not exactly what I’m looking for. I’m looking for a VBS script that I can push out with group policy and scheduled tasks for our XP, Vista, Win 7 machines that will prompt a user that their computer will shut down in 60 seconds to save energy. Press Ok to shut down immediately or press Cancel to keep working. And if the user does nothing it will force terminate all applications and shutdown the computer at the end of 60 seconds. Can anyone help me out with this?

Thanks!
Steve
0
Comment
Question by:swthpk32
7 Comments
 
LVL 7

Expert Comment

by:Jacobfw
ID: 36973761
0
 

Author Comment

by:swthpk32
ID: 36973886
The concept is right but I don’t want to do it by OU. I want to copy it to the local machine; use GPO scheduled task's to execute it at a set time. But if a user is working at that set time they have the option to cancel it or click ok to shut it down right away or it just times out after 60 seconds and does it for them.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Accepted Solution

by:
swthpk32 earned 0 total points
ID: 36974144
Osama,

The last one is pretty close but it would need to be tweaked for what im looking for. I just found one i can get to work! http://community.spiceworks.com/topic/136533-vbscript-shutdown-assistance
0
 

Author Comment

by:swthpk32
ID: 36974149
Will a VBS still work if the computer is still locked?
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 36974396
Hi, what about a script like this?

Rob.
intSeconds = 60
Set objShell = CreateObject("WScript.Shell")
objShell.Run "shutdown -s -f -t " & intSeconds, 1, False
intReturn = objShell.Popup("Do you want to abort the shutdown?", intSeconds, "Abort shutdown?", vbYesNo)
If intReturn = 6 Then
	objShell.Run "shutdown -a", 1, True
End If

Open in new window

0
 

Author Closing Comment

by:swthpk32
ID: 36998389
I found it on my own on another site
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When asking a question in a forum or creating documentation, screenshots are vital tools that can convey a lot more information and save you and your reader a lot of time
This article shows how to use a free utility called 'Parkdale' to easily test the performance and benchmark any Hard Drive(s) installed in your computer. We also look at RAM Disks and their speed comparisons.
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…
Suggested Courses

862 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