VBS Script to Shutdown Computers

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
swthpk32Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

JacobfwCommented:
0
swthpk32Author Commented:
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
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

swthpk32Author Commented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
swthpk32Author Commented:
Will a VBS still work if the computer is still locked?
0
RobSampsonCommented:
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
swthpk32Author Commented:
I found it on my own on another site
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.