How to shutdown windows computer from the DOS Prompt – what command to use

This off-topic from Java but might sometimes be needed for a java developer so thought of posting it. It’s a kind of windows tips.

Sometimes, you might not be able to shutdown the computer from the windows due to some policies setup for that machine. For example I am not allowed shut down a shared machine or a server that is running application server. There is a hack. An alternate way to shutdown and restart the computer is to pass the shutdown command from the dos prompt. I have always been successful.

  • Shutdown –s [shutdowns the computers]
  • Shutdown –r [restarts the computer]
  • Shutdown –l [logs off the computer]
  • There are several other parameters that you can pass to shutdown command. Simply runt he command shudown/? to see other flags that you can pass to this dos command.
Usage: shutdown [-i | -l | -s | -r | -a] [-f] [-m \computername] [-t xx] [-c "comment"] [-d up:xx:yy]

	No args			Display this message (same as -?)
	-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 \computername	Remote computer to shutdown/restart/abort
	-t xx			Set timeout for shutdown to xx seconds
	-c "comment"		Shutdown comment (maximum of 127 characters)
	-f			Forces 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)

How big can a computer memory be? Here is a list of memory units from Bit to Coperbyte.

  • 1 Bit = 1 Binary Digit
  • 8 Bits = 1 Byte
  • 1024 Bytes = 1 Kilobyte
  • 1024 Kilobytes = 1 Megabyte
  • 1024 Megabytes = 1 Gigabyte
  • 1024 Gigabytes = 1 Terabyte
  • 1024 Terabytes = 1 Petabyte
  • 1024 Petabytes = 1 Exabyte
  • 1024 Exabytes = 1 Zettabyte
  • 1024 Zettabytes = 1 Yottabyte
  • 1024Yottabytes = 1 Brontobyte
  • 1024 Brontobytes = 1 Geopbyte
  • 1024 Geopbyte = 1 Saganbyte
  • 1024 Saganbyte = 1 Pijabyte
  • 1024 Pijabyte = 1 Alphabyte
  • 1024 Alphabyte = 1 Kryatbyte
  • 1024 Kryatbyte = 1 Amosbyte
  • 1024 Amosbyte = 1 Pectrolbyte
  • 1024 Pectrolbyte = 1 Bolgerbyte
  • 1024 Bolgerbyte = 1 Sambobyte
  • 1024 Sambobyte = 1 Quesabyte
  • 1024 Quesabyte = 1 Kinsabyte
  • 1024 Kinsabyte = 1 Rutherbyte
  • 1024 Rutherbyte = 1 Dubnibyte
  • 1024 Dubnibyte = 1 Seaborgbyte
  • 1024 Seaborgbyte = 1 Bohrbyte
  • 1024 Bohrbyte = 1 Hassiubyte
  • 1024 Hassiubyte = 1 Meitnerbyte
  • 1024 Meitnerbyte = 1 Darmstadbyte
  • 1024 Darmstadbyte = 1 Roentbyte
  • 1024 Roentbyte = 1 Coperbyte