I would like to write a VB script to auto shut down Win2k and WinXP. I wrote the script and kept it in a *.bat file, but it still failed to shut down. Please advise.
When I started looking at this question, I didn't realize there were so many ways to shut down a machine! For Windows XP and Windows Server 2003, a new command line program, SHUTDOWN.EXE, takes all the work out of it. Using the command "SHUTDOWN -s -t 1" will turn off the computer immediately. The "-s" command line options specifies shutdown, and the "-t 1" says to delay one second (in other words, immediately). The SHUTDOWN program also powers off the machines if they have relatively recent BIOS.
By submitting your personal information, you agree that TechTarget and its partners may contact you regarding relevant content, products and special offers.
In researching this question, I was all set to write some VBScript code to do the shutdown on Windows 2000 when I ran across Rob van der Woude's outstanding scripting resource page. On Rob's Web site there are all sorts of great Windows Script Hosting (WSH) examples as well as batch files galore.
Dig Deeper on Win Development Resources
Related Q&A from John Robbins
What is a JAD session? This term is referred to often in job postings and seems like some kind of brainstorm you carry out with a client to define IT... Continue Reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.