Skip to main content

Shutdown Command Via Command Prompt

The 'Shutdown' Command Becomes More Flexible and Automated when used from the Command Prompt.

To Run the 'Shutdown' command from the command prompt, go to 'Start > Run', type 'cmd', and press 'Enter'.
In the black box (the command prompt) type 'Shutdown' and the Switches you want to use with the 'Shutdown' command.
You have to use at least one switch for the shutdown command to work.

The Switches :-
The 'Shutdown' command has a few options called Switches. You can always see them by typing 'shutdown -?' in the command prompt if you forget any of them.

-i: Display GUI interface, must be the first option
-l: Log off (cannot be used with -m option)
-s: Shutdown the computer
-r: Shutdown and restart the computer
-a: Abort a system shutdown
-m \\computernameRemote computer to shutdown/restart/abort
-t xx: Set timeout for shutdown to xx seconds
-c “comment”: Shutdown comment (maximum of 127 characters)
-fForces running applications to close without warning
-d [u][p]:xx:yy: The reason code for the shutdown u is the user code p is a planned shutdown code xx is the major reason code (positive integer less than 256) yy is the minor reason code (positive integer less than 65536)

Note :- I’ve noticed using a switch with a '-' sign doesn’t work sometimes.
If you are having trouble try using a '/' in place of '-' in your switches.

Examples :-
shutdown –m \\computername –r –f
This command will restart the computer named computername and force any programs that might still be running to stop.

shutdown –m \\computername –r –f –c “I’m restarting your computer. Please save your work now.” –t 120
This command will restart the computer named computername, force any programs that might still be running to stop, give to user on that computer amessage, and countdown 120 seconds before it restarts.

shutdown –m \\computername –a
This command will abort a previous shutdown command that is in progress.

Using A Batch File :-
You can create a file that performs the shutdown command on many computers at one time.

In this example I’m going to create a batch file that will use the shutdown command to shut down 3 computers on my home network before I go to bed.

Open 'Notepad' and type the shutdown command to shut down a computer for each computer on the network.
Make sure each shutdown command is on its own line.
An example of what should be typed in notepad is given below-

shutdown –m \\computer1 –s
shutdown –m \\computer2 –s
shutdown –m \\computer3 -s

Now I’ll save it as a batch file by going to file, save as, change save as type to all files, give the file a name ending with '.bat'. I named mine 'shutdown.bat'.
Pick the location to save the batch file in and save it.

When you run the batch file it’ll shutdown computer 1, 2, and 3 for you.

You can use any combination of shutdown commands in a batch file.



LIKE,COMMENT AND SHARE MY THIS ARTICLE 

AND BE A FAN OF THIS BLOG.

Like us on facebook Just click here.

Comments

Popular posts from this blog

Edit tiles in Windows 8

If you’ve recently installed or upgraded to Windows 8 and have started customizing programs onto its new Start Menu UI, you’ll notice that the program icons are the same old icons placed in an oversized box. You’ll see the program name under it and will be in awe at  how out of place the newly added icons are with the rest   of the Windows 8 theme. We’ve found a handy program to spruce things up by  creating awesome-looking tiles that match the look of Windows 8 apps  on the Start Menu, something like what you see below. And you can get that look using   OblyTile . First thing’s first, the icons you see above are works from users of deviantART. OblyTile only sets up your tiles; you have to provide the icons or images for the tile. But not to worry, we’ll provide you with  a few links which we’ve found to recreate the look and feel  of the screenshot you see above. Getting Started With OblyTile Run OblyTile (no insta...
How To Speed Up Internet Speed A slow Internet connection can be very annoying when you are trying to do something on the Internet. Here are some steps you can take to fix or improve your connection. Steps   1 Identify what speed you are supposed to be provided by your Internet Service Provider (ISP) . This is important, because your slow connection could be due to a problem on their end, not yours. This should be on your bill. If you don't have a bill handy, you can check the ISP's website or contact them directly to find out. 2 Conduct a  speed test  online . This should get you results close to what your ISP is supposed to provide. If you get a low result, try another computer on your network first. If both get a low result, contact your ISP. If only yours has a problem, the problem lies with the computer. 3 Eliminate needless programs . Your Internet connection requires memory to be able to be at ...

How to create a logo...

A professional logo can enhance a company, an organization, or a product.  On the other hand, an unprofessional logo can ruin a brand and mar an otherwise good designer’s portfolio. Many logos in use are unprofessional and carry all the tell-tale marks of an amateur or a beginner. Everyone thinks they can design a great logo, but simply knowing your way around Photoshop is not enough. Here are some insights into the process and workflow of effective and modern logo design.  With these tips and your creativity, you can make your logo designs shine with the very best . 1. Design: Sketch and Brainstorm A lot of beginners jump right onto the computer to create a logo . However, more often than not, a lot of time is spent fiddling with special effects and filters. While this can be useful, it usually means that the thoughtful design and artistry of the logo itself has taken a back seat. A better way to start is to get a fresh sheet of paper and a pencil . Think ab...