How to shutdown, restart, logoff using command prompt?

Windows provides a builtin command to shutdown, restart as well as logoff a user from the command promptne. This and many other options are provided by the “shutdown” command. In order to find out more options of any command, type :

shutdown /? – command name followed by a forward slash and a question mark.

in Command Prompt ( WIN + R » cmd – here are some more Windows Keyboard shortcuts. You can run any command from Command Prompt or typing the command with full option into the RUN Dialog ( WIN + R ) The main use of all these commands come in batch files and task scheduling. All of these commands are pretty easy to use, please read the article completely before complaining 😉

Basic form of “shutdown”

The most basic form of the command is :

shutdown -OPTION
OR
shutdown /OPTION

Both perform the same thing – execute shutdown command with option OPTION. OPTION can take many values, only the ones of interest to us are mentioned here.

-l – Logs off the current user
-s – Shutdown the computer
-r – Restart the computer

-a – Aborts a current shutdown command execution

-t XX – if this is added with any of the above ones, you can specify after what time ( XX seconds ) the system should execute the OPTION.

A Simple example and a Screenshot

Here the OPTIONs specify that shutdown command should shutdown the command after 120 seconds.

RUNning “shutdown” command with options -s -t 120

shutdown -s -t 120

The screen result will be something like this :

Before shutdown, the logged in user is warned about the event and the time frame.

Canceling a shutdown

If you have given the time parameter -t XX you will have sometime before the command kicks you out. In that time, if you want to cancel the event just type :

shutdown -a -Abort a shutdown

shutdown Aborted – notification

Add a message

You can add a custom message with shutdown so that, instead of the time frame warning, the user will be presented with your message.

shutdown -s -t 120 -c “You are so screwed”

will present the user with the message – “You are so screwed” as below :

Custom message with “shutdown”

More about shutdown on Microsoft KB | Built in parental control in Windows XP

104 thoughts on “How to shutdown, restart, logoff using command prompt?”

  1. Good day very cool website!! Guy .. Excellent .. Superb ..
    I’ll bookmark your site and take the feeds additionally?
    I’m happy to seek out so many helpful information here within the
    put up, we want work out more techniques on this regard, thanks for sharing.
    . . . . .

  2. Wow, superb weblog structure! How lengthy have
    you been running a blog for? you make blogging look easy.
    The whole glance of your web site is fantastic,
    as neatly as the content!

  3. My relatives every time say that I am killing my
    time here at net, except I know I am getting knowledge
    every day by reading such nice articles.

  4. Have you ever thought about publishing an e-book or guest authoring on other blogs?
    I have a blog based on the same topics you discuss and would love to have
    you share some stories/information. I know my viewers would appreciate your work.
    If you are even remotely interested, feel free to shoot me an email.

  5. magnificent publish, very informative. I wonder why the opposite
    experts of this sector don’t notice this. You
    should proceed your writing. I’m confident, you’ve a huge readers’ base already!

  6. What’s up, yeah this piece of writing is actually pleasant and I have learned lot
    of things from it about blogging. thanks.

  7. t miiss out oon the easiest and best time tto start a business ever.
    They are still popular, however the ease and the flexibility to change the content off these classifieds is something that makes posting of these ads on the internet, a grrat option. Until the US organizes a similar advertising standards authority, we all have the power to identify,
    challenge and most importantly ignore ads that mmake us feel badly about our bodies.

  8. I’ve been surfing online more than 3 hours
    today, yet I never found any interesting article like yours.
    It’s pretty worth enough for me. In my view, if all website owners and bloggers made good
    content as you did, the internet will be much more useful than ever before.

  9. I’ve been exploring for a little bit for any high-quality articles or weblog posts in this kind of area
    . Exploring in Yahoo I ultimately stumbled upon this website.
    Studying this information So i’m glad to convey that
    I’ve a very excellent uncanny feeling I found out just what
    I needed. I most for sure will make certain to do not omit this site and provides it a look on a relentless basis.

  10. When some one searches for his necessary thing, so he/she needs to be available that
    in detail, thus that thing is maintained over here.

  11. Please let me know if you’re looking for a author for your blog.
    You have some really great articles and I believe I would be a good
    asset. If you ever want to take some of the load off, I’d love to write some
    content for your blog in exchange for a link back to mine.
    Please send me an e-mail if interested. Regards!

  12. What’s Happening i am new to this, I stumbled upon this I have found It
    absolutely useful and it has aided me out loads. I am hoping to give a contribution & assist other customers like its aided me.

    Great job.

  13. With havin so much written content do you ever run into any
    issues of plagorism or copyright violation? My website has a
    lot of exclusive content I’ve either authored myself or outsourced but it
    looks like a lot of it is popping it up all over the internet
    without my authorization. Do you know any methods to
    help protect against content from being ripped off?

    I’d genuinely appreciate it.

  14. hose are sneakers that were meant for sportswear. It was very desirable and pleasing to the eyes of individuals who sincerely enjoy sports footwear. The Nike Air Force A single Footwear had been offered in about all Nike shoe outlets globally and it expense for about 80usd for the common design but

  15. Russia is one of the most beautiful countries in the world. Its rich heritage, extraordinary scenic beauty with green meadows and rivers make Russia a top choice for visitors to spend their holiday. Within Russia itself, Saint Petersburg is undoubtedly the most beautiful city.Innumerable tourists fr

  16. Due to the fact raising acceptance inside the pokemon cosplay and specially Pikachu cosplay, we’re able to easily encounter that a great deal much more cosplayers engage in this particular job involving cosplay day-to-day. You can find different China wholesale stores over world wide web promoting h

  17. the first step inside journey towards finding Marketing Director jobs is usually to truly know very well what the job responsibilities are. Of course the obvious responsibility of promoting Director jobs are to get the leading force behind the look and operation of an companies marketing plan. Addit

  18. Its time to get this information in the new Activity that has
    been created. If not, just follow the instructions on screen to set up an account.
    However this is playing out as a game of cat and mouse, as new exploits
    are discovered sometimes within hours of the latest patch.

  19. Its time to get this information in the new Activity that has
    been created. If not, just follow the instructions on screen to set up an account.
    However this is playing out as a game of cat and mouse, as new exploits
    are discovered sometimes within hours of the latest patch.

  20. Its time to get this information in the new Activity that has
    been created. If not, just follow the instructions on screen to set up an account.
    However this is playing out as a game of cat and mouse, as new exploits
    are discovered sometimes within hours of the latest patch.

  21. Because if you want people even to stay on your site, let alone buy your product or service, you
    have to give them reasons to believe what you say. Further, while
    considering the option of article marketing, it is good not to have
    the paragraphs that are longer than about 5 to 6 sentences.
    Read Bad Blogs – Go to the Internet and search
    anything you’d like, then add the world blog to your search.

  22. You can certainly see your expertise within the work you write.
    The arena hopes for even more passionate writers like you who aren’t afraid to mention how they believe.
    All the time go after your heart.

  23. The web is stuffed to the gills with blogs just like yours, and if you’re
    dealing with a reputation management attack, you’re probably trying
    to out-rank other blogs that have the very same
    keywords. In fact, blogging, if done properly,
    can positively affect your business in many different ways.
    Another big topic people love to blog about is their family.

  24. That’s why horse racing handicapping is really
    a frightening intellectual sport. Other factors, for instance pedigree,
    trainer and jockey riding the horse and regardless of if
    the horse performs well within the turn or on dirt are carefully considered by handicappers into their quest
    for your win. You will most likely get a number of numbers that represent a
    unique contest along with the corresponding rank with the animal
    during that time.

  25. ???2010??????????????????????????????????????????????????????????????????2010??????????????srq009????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? http://www.fujisanbrand.com/watch/bvlgari/index_3.html

  26. “???????? ???????? ??? ??(N?)??????????????? ??? ??????? ?????????? ??? ??????????????? ??????????????????????????????????????????????? ???????????? ?????????????????????.???????????No.1????????????????????????? ????? ??????????? ???? ??????????? ???????? ????????? ????????? ??????D&G ???????? ????? ??? ????? ?? ?? ???? ?????? ??? ?????? ??? ?????? ???????????????????????????????????????????????? ??? ????????????????????????????????????????????????????????? ????????????????????????? http://www.eevance.com/tokei/chopard

  27. On the e-discovery lecture circuit Ron Losey has been discussing
    it for years over on his irreverent and groundbreaking e-discovery crew website, and it’s a frequent theme of keynote speakers.
    Typically the device is much cheaper to run than a traditional cigarette, with the equivalent of 20 cigarettes costing on $0.

    Of the many vices and habits that humans have, smoking is known to be one of the most dangerous.

  28. 2015????????????????????????????????????????????????????????????????????????????????????????????????????????????.?????????????????????????????????? ?????????????????????????????_?????????IWC????????????????????? ????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????.????????????? http://www.ooowatch.com/tokei/chanel/index_3.html

  29. ???????????????????????????????????????????????????????????????????????? ????????????????????????????????????IWC????????????????????????????????????????????????????????????? 2015????????????????10% ? ????????! ? ?????????????? ? 100%?????? ? ???????(????)!? ????????????? ????: ??????????????????????????????????????? http://www.newkakaku.com/ldb1.htm

  30. ??????????,????????,??????????,???&???????????????????????????????7????????? ???????????????????????????? ????? ??????????????????????????? ????????? ????? ????????????????????????????????? ?IWC??? ??????? ????????? ???????????? ???&????? ??????????????????????????????????????????? ??????????????????????????? ??????????????????????????? ??????????????????????????? ??????????????????????????? ??????????????????????????? ?????????? ,???&???????????????????????????????7????????? ???????????????????????????? ????? ??????????????????????????? ????????? ????? ????????????????????????????????? ?IWC??? ??????? ????????? ???????????? ???&????? ??????????????????????????????????????????? ??????????????????????????? ??????????????????????????? ??????????????????????????? ??????????????????????????? ??????????????????????????? ?????????? http://www.okakaku.com/brand-23-copy-0.html

  31. ????????????????????????????????????????????????????????(FUKUSHOW?????????????????????? ?????????????N??????????????2????????????,??????????????????? ?????????,??????????? ?????????? ???????,???????????????????????????? ???????,???????ROLEX????IWC ???????,???????IWC???????????????????,???????hermes?????????? ???????????,????????????????????????????????????????????????? http://www.gginza.com/bag/chanel/index.html

  32. ??????????????????,????????,???????? ??? ?? ???? ??(CHANEL),??? ?? (GUCCI) ??,????(lv) ?? ?? ?? ???????????,?? ????????????????????????????????????????????????????????????,??????????,???????,??????????????,??????? ??? ???????? ?? ???????? ????? ??? ??????? ????????????????????????????????? ??????????????????????.????????????????????? ????????????????????IWC???????????? ??????????? http://www.brandiwc.com/brand-37-copy-0.html

  33. 2015?????-??!??? ????????? ?N?????????????????????????????HERMES??????????? CHANEL???????????LOUIS VUITTON?????????????? BVLGARI???????Christian Dior???????? COACH????????GUCCI???????? ROLEX????OMEGA???? IWC????FRANCK MULLER???? HUBLOT??????? CHLOE?????????????? ?????????????????????
    ???????????,??????????????????????????????????? ????????????????????IWC???????????? ??????????????????????????????????????????????????????????????????,????????,??????????,??????????,??????????,?????????,??????,???????????????????????????????????????????????????????????????????????SS??N?????????????2015????????????????????(????) http://www.gginza.com/wallet/chanel/index.html

  34. ????N????????? ???,?????????,????N??,?????????,,???????????????????????????????????,??????????????.???No.1???????,?????????????????????????????????????????? ???????????????????? ???N??? ??????????.???????????????????? ?????????!?????????2????????
    ????????????????????????????????????????????????????????(FUKUSHOW?????????????????????? ?????????????N??????????????2????????????,??????????????????? ?????????,??????????? ?????????? ???????,???????????????????????????? ???????,???????ROLEX????IWC ???????,???????IWC???????????????????,???????hermes?????????? ???????????,????????????????????????????????????????????????? http://www.gowatchs.com/brand-237.html

  35. ????????????????????????????????????????? ????? ??????? ?? ????? 28800?? (???)???? ????? ??????? ?? ????? 28800?? (???)? BOX? ??????????????????????????????????????????????????????????????? 35Q?????????????????????????????????????????????????????????????
    ?????????????????????????,????????,2015???????????????????????.?????????????????,???????????????,????????????????????????????????????????????????…??????????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????????????????????? ??????????????????????????????? ?????????????????????????????????????????????????????????n?????????!????????,???????,??????,??????,??????????,????????????????????????????????????????HERMES???????? CHANEL????????LOUIS VUITTON???????? BVLGARI??Christian Dior???????? COACH????)GUCCI???????? ROLEX????OMEGA???? IWC???? http://www.ooobrand.com/bags/prada/index.html

  36. ????????????? ??????????????????????(N??)?????!???????,???????,???????????,??????? ??,???????????????????????????????????????????????????????????????
    ????????????????????????????????????? ????????????????????IWC???????????? ??????????????????????????????????????????????????????????? http://www.newkakaku.net/prada.htm

  37. ?????
    ?????????????????????????????? ???? ??? ???? ????? ROLEX VUITTON CHANEL GUCCI HERMES ROLEX S? VUITTON S? CHANEL S GUCCI S? HERMES S? ROLEX AAA? VUITTON AAA? CHANEL AAA? GUCCI AAA? HERMES AAA?? N???? ????S?? ????S?? ???S?? ????S?? ?????S?? ?? ????AAA?? ????AAA?? ???AAA?? ????AAA?? ?????AAA?? ???? ??? ???? ???? ?? ???? ????????????????????? S?? ???????? ???? S?????? AAA? ???? ???? ???? ??? ???? S?????? ??? ???? S?????? ?? ???? ???????????????? VUITTON???????? VUITTON??? ????? ???????? S????????? S??????????? ????????????? ???????????? ROLEX ??????? CHANEL?????? CHANEL??????? S?? ???(Rolex)???? S?? ???? ??? ??????? ???? S?????? ?????????????????????????? ????(????) ???????????!?????????????????????????????????????????????????.????????????????????????100%????????????????100?! http://www.bestevance.com/RogerDubuis/index_3.html

  38. 2015????????????????????????????????????????????????????????????????????????????????????????????????????????????.?????????????????????????????????? ?????????????????????????????_?????????IWC????????????????????? ????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????.?????????????
    100%???????????????!”??????????????? ????????? ??????????,????????????????????????????????????????????????? ?????????????? ????????????????? ????????? ??????????,???????????????-jck35??:?????????,??????,?????,?????,? ??????,????????,???????,???????,??????????, ?????????,????????,????????,D&G ?????,???? ?? .2013???????????????,???????????????????? ??????????????????????????????????? ?????????????????????.????????,??No.1??????????????????????????????ROLEX?????????????? ?????????????????????2???????,????? ??????? ??,????????? ???n??????? http://www.okakaku.com/brand-24-copy-0-cheap-0-max0-attr0-6-sort_order%20Desc%2cgoods_id-DESC.html

  39. ???????????????? ?????????????????N ???? ??????????? ??????????,?????? ?????????????? ???????????????????? ??????????????????????????????????????????????????????????????????? ??????????
    ?????????????????????????????????????? ???????????????????????????????? ???????????? ??????????????????????????????????????????????????????????????? ????????????????????????? ????????gaga????????, ?/????,???????? http://www.wtobrand.com/he1.html

  40. ?????????,???,??| ????????????????????????????????????????????????????????(FUKUSHOW?????????????????????? ?????????????N??????????????2????????????,??????????????????? ?????????,??????????? ?????????? ???????,???????????????????????????? ???????,???????ROLEX????IWC ???????,???????IWC???????????????????,???????hermes?????????? ???????????,?????????????????????????????????????????????????
    ???????????????????????????????????????????? ??????????????????????????????????????????????9????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? http://www.bagkakaku.com/cariter_watch.html

  41. Very informative post, i’m regular reader of your blog.
    I noticed that your blog is outranked by many other websites in google’s search
    results. You deserve to be in top-10. I know what can help you, search in google for:
    Omond’s tips outsource the work

  42. Thanks for a marvelous posting! I quite enjoyed reading it, you could be a great author.
    I will be sure to bookmark your blog and definitely will come back down the road.
    I want to encourage you to definitely continue your great
    work, have a nice day!

  43. hello!,I like your writing very so much!
    proportion we keep in touch more about your post on AOL?
    I need a specialist on this house to resolve my problem.
    May be that’s you! Taking a look forward to see you.

  44. All those command are really working good.
    How can I use cmd command to find out the ip address of systems within my location or with and without internet connections.Also how can I use my own system to change the password of another system and shut it down using cmd prompt command or with and without internet connections.
    Friends any body that have the knowledge of it should please send the codes and step to follow to this mail box asadoc02@gmail.com.
    I love you all.
    Thank you all and GOD bless you all.

  45. So, you just have to complete a uncomplicated survey and your download will start
    automatically. A survey (scrolll in excess of to see what you
    have to do in buy to comprehensive). The download will begin automatically.

  46. These software come with minimum memory requirements and do not affect the smooth functioning of your smartphone.

    The LG 32LD550 model offers streaming video services including Netflix,
    Vudu, and Youtube. Only one barstool is placed off in the centre of the
    stage together with a mike stand.

  47. s brides are opting for unique twists to the traditional guest book.
    It was shocked that Leader Kim died at age 69 of a heart attack
    on December 17 while on a train journey. Gara believes
    the upgrade fee will be at a heavy discount in comparison to the retail price.
    It will make for a better environment for everyone.
    Players can “guest” to another World, where they can level with friends.

    After that, the main act resumed his round of
    super hits, attracting considerable attention with his heart warming rendition of “Just The Way You Are. Of course, in this day and age, it’s hard to find hopping and bumping centenarians. Most kids don’t like the dentist or the doctor for shots so these people can break the ice and get the kids to relax before getting their teeth cleaned or their shots for the year. Rather than showing the madness, much of the dialog just states that he is mentally ill, making it harder for actor Noel Milan to truly convey his madness. You may think this is extreme, but that is the logical next step from backdoor monitoring. These would be bonus hearts that allow that student to draw two pink hearts, rather than one, on their turn. This is where the importance of CD & DVD duplication comes with @mediaxpress. The players manoeuvre for position and carry out attacks and counterattacks in the middle game. Randy Pitchford of Gearbox Software today posted a new set of shift codes for the recently-released multiplatform title, ‘Borderlands 2,’ in celebration of the upcoming New Year. Masterluck recommends the Inverted Lottery System after much research and study. The Nintendo Wii Match Plus or Nintendo Wii Suit 2 is the best addition to the previously well-known Nintendo Wii Bundle. They can be used for weaponry, fireworks, ejection seats, launching vehicles like spacecrafts for artificial satellites, human space flight and discovery. At Howl-O-Scream, even the sidewalks aren’t safe from the things that go bump in the night, where three all-new scare zones will keep guests watching their backs as they explore 335 acres of fright. Jet – Pac is a ZX Spectrum, VIC-20 and BBC Mico video game developed and released by Ultimate Play The Game in 1983. This program will be available starting on December 6 in Japan. However it might signify although this is best version of the adventure, its perhaps not each defined an the product couldve recently been. You can learn about new things as well as our history and how we got here. Instead, they can use the free and open source project, Mono, which can be run on Android, i – OS, and many other operating systems. On the other hand, the person who did get the promotion had just happened to overhear her boss talking to Jim. -based terror plots and incidents, and this is a serious security issue.

  48. Its like you read my mind! You seem to know so much about this, like you wrote the book in it or something. I think that you could do with a few pics to drive the message home a little bit, but other than that, this is great blog. An excellent read. I will certainly be back. caeffabeakeb

  49. I like the valuable info you provide in your articles. I
    will bookmark your weblog and check again here frequently.

    I am quite sure I will learn many new stuff right here!
    Best of luck for the next!

  50. Hey! I know this is kinda off topic but I was wondering which blog
    platform are you using for this website? I’m getting fed up of WordPress because I’ve had problems with hackers and I’m looking
    at alternatives for another platform. I would be great if
    you could point me in the direction of a good platform.

  51. These collars should only be used while actively trainijng or exercising your canine.

    Cana – Dog Racing Dog Colllars can be used for dogs who need to be temporarily tethered as they are extremely durable and hzve nnot parts which ccan break or come apart
    if the dog tugs or pulls against a tether.

    But overall, it’s still one off the best GPS pet locators annd it’s also great for training hunting dogs too, thanks to soe of the featues listdd in the
    review linked above.

  52. Hi, i just try it, but command prompt displays the message as “Access deined” then how to solve this problem and shutdown the system.

  53. The batch file is simple, it contains only 1 line:

    shutdown -s -t 5

    Run it with the highest privileges under taskscheduler.

  54. Why is my laptop so laggy all of a sdduen?Just yesterday I restored my Sony PCG-FXA47 because it was running slowly, after I restored it, I uninstalled all of the programs that I did not need. It was running very fast, but the next day, all it was doing was lagging. I am running Windows XP Home Edition SP2. I am going to try a registry fix, but I have already done a disk cleanup, disk defragmentation, and I have deleted all offline content, deleted all of the history and cookies, deleted temporary files, and manged my startup items. I don’t want to do a RAM upgrade just yet, but I want to know if there is anything else that I can do to stop my laptop from lagging. I have tried programs like Tune Up Utilities 2009, it did help me a little, but my laptop started lagging uncontrollably the next day. I haven’t tried a registry clean just yet, but I want to know if it would make a significant difference. All the programs that I have on my laptop combined take up no more than 100 Megabytes. I am running a Sony PCG-FXA47 256mb of RAM 20gb hard drive(I know it’s not much) 32-bit Windows XP Home Edition SP2 1GHz AMD Athlon 4 ProcessorIt cost 1,000 bucks in 2001!!!

  55. i want to ask one little thing, how to hack school computer include all program..i used all type of cmd , but is is useless….

  56. Hi All,

    To shutdown a computer via a network or lan.. click stat / run / shutdown -i

    Enter the compuer name. Select the option from the drop down menu “shutdown” “Restart” or “Logoff” set the time to show the message. then have the message to what ever you like then press ok.

  57. Dear Leam it work in windows 7 please follow the instruction it helps in all the command
    shutdown -r
    shutdown -s
    shutdown -l

  58. I don’t think you can run this command on a remote computer. I think pstools can help you acheive this. PSTools lets you run commands on remote computers.

  59. Great Job! I have a bone deformity in my mouse hand and due to the pain that come after an extended period of time with a mouse, this makes my life just a little easier. Thanks so much!

  60. I’m trying to test this batch file but not working, can somebody how I can change it to work:

    %rightnow% = time /t
    %starttime% = “12:00 AM”
    %endtime% = “05:00 AM”

    rem “trying to find out if current time is between 12 and 5 AM”

    if “%rightnow” geq “%startime” and %rightnow% leq %endtime%

    echo “between 12 and 5 AM”
    else
    echo “it is okey”
    end

    quit

  61. Hi Phalla,
    can you please tell me the specific error shown when you type the command.. or better can you add a screen shot of the command prompt when you do this.

  62. i know all this command but i cannot restart a pc in network. why? All you detail about this command are useful but i still cannot do it.

  63. Hi Arne please try the IP of the computer you are trying to shutdown. Use IP.IP.IP.IP instead of \\XXXXX The IP of the remote computer can be found easily by opening the command prompt and then typing “ping \\XXXXX” You can see the IP there. Please tell me if your problem have been resolved.

  64. Hello! When i am using any commands on my computer it works great, but if i’m trying to use it on a computer in a LAN it doesn’t word, it just syas that it can’t find the network adress.
    I’m typing in the following command:
    shutdown /s /m \\XXXXX /t 005

    and i’ve checked that the computer name is correct.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>