Shutdown / Restart

Discussion in 'Windows 10' started by Pasta88, Mar 8, 2018.

  1. Pasta88

    Pasta88 MDL Expert

    Joined:
    Jun 17, 2009
    Messages:
    1,154
    Likes Received:
    29
    Trophy Points:
    60
    Hi, I was wondering if there was a quicker way to shutdown or restart a pc by clicking on an icon?

    thx
     
  2. kaljukass

    kaljukass MDL Guru

    Joined:
    Nov 26, 2012
    Messages:
    2,436
    Likes Received:
    883
    Trophy Points:
    90
    #2 kaljukass, Mar 8, 2018
    Last edited: Mar 12, 2018
    Make desktop shortcut or put into rightclick menu
    Shutdown

    %SystemRoot%\System32\shutdown.exe /f /s /t 0
    Restart
    %SystemRoot%\System32\shutdown.exe /f /r /t 00
    Log Off
    %SystemRoot%\System32\shutdown.exe /f /l
    f - forced
    s - shutdown
    r - restart
    l - log off
    t - time before process begins in seconds , 0 or 00 means immediately

    Abort all previously given processes(shutdown, restart):
    %windir%\System32\shutdown.exe -a

    Sleep
    %SystemRoot%\System32\rundll32.exe powrprof.dll,SetSuspendState 0,1,0
    Hibernate
    %SystemRoot%\System32\rundll32.exe PowrProf.dll, SetSuspendState

    Kill or running programs
    %SystemRoot%\System32\taskkill.exe /F /FI "USERNAME eq Your username" /FI "IMAGENAME ne explorer.exe" /FI "IMAGENAME ne dwm.exe

    NB! replace username with Your username

    UAC Settings
    %windir%\system32\useraccountcontrolsettings.exe

    Screen Saver Settings
    %SystemRoot%\System32\rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,1

    Local Group Policy Editor
    %windir%\System32\gpedit.msc

    User password asking =>turn it on or off if computer starts
    %windir%\System32\control.exe userpasswords2

    Show/hide taskbar hidden icons(these what is on rightside on taskbar) old look (like it was in win7)
    Notification Area Icons
    %windir%\explorer.exe shell:::{05d7b0f4-2121-4eff-bf6b-ed3f69b894d9}

    UWP File Explorer (windows built in app)
    %windir%\explorer.exe shell:AppsFolder\c5e2524a-ea46-4f67-841f-6a9465d9d515_cw5n1h2txyewy!App

    On-Screen Keyboard
    %windir%\system32\osk.exe

    What else would be need?
     
  3. tnx

    tnx MDL Expert

    Joined:
    Sep 2, 2008
    Messages:
    1,660
    Likes Received:
    256
    Trophy Points:
    60
    I have put a couple shortcuts on the Start Menu for shutdown and restart, plus on he context menu too. They work a treat.
    Later on when I fire the thing up I will gather my scripts and share.
    Grabbed a couple of nice looking icons too to make things look pretty.
     
  4. Evides

    Evides MDL Member

    Joined:
    Apr 6, 2014
    Messages:
    114
    Likes Received:
    24
    Trophy Points:
    10
    #4 Evides, Mar 8, 2018
    Last edited: Mar 8, 2018
    Or if you want some eye candy you can install Rocket Dock (or any other dock for Windows) and use their shut down and restart icons.

    BTW: 'Afsluiten' is Dutch for 'Shut Down'... ;)

    IMG_20180308_162115.jpg
     
  5. tnx

    tnx MDL Expert

    Joined:
    Sep 2, 2008
    Messages:
    1,660
    Likes Received:
    256
    Trophy Points:
    60
  6. kaljukass

    kaljukass MDL Guru

    Joined:
    Nov 26, 2012
    Messages:
    2,436
    Likes Received:
    883
    Trophy Points:
    90
    One small note: I recommend using / not -
    - used in XP and also in Vista, but the newer is /, although - works also.
     
  7. Pasta88

    Pasta88 MDL Expert

    Joined:
    Jun 17, 2009
    Messages:
    1,154
    Likes Received:
    29
    Trophy Points:
    60
    Thx guys, they worked nicely.
     
  8. dmex

    dmex MDL Junior Member

    Joined:
    Apr 20, 2011
    Messages:
    95
    Likes Received:
    105
    Trophy Points:
    0
    While I admire the enthusiasm of the above posters... There is quicker, easier and more reliable way to shutdown your machine than the above methods.

    Just press the power button on your PC and it will initiate a (clean) shutdown of the machine - just like the methods posted above.

    You can also hold down the power button for 3 seconds to initiate a (dirty) shutdown of the machine.
     
  9. Enthousiast

    Enthousiast MDL Tester

    Joined:
    Oct 30, 2009
    Messages:
    35,567
    Likes Received:
    59,638
    Trophy Points:
    450
    Yes, press it 4 seconds to shutdown, next boot it will ask if you want to troubleshoot or start scanning the drives for errors ;)

    All the "fast" shutdowns above override the windows actions to show that there still are programs or other important files opened, and it will shutdown and not saving the files.
     
  10. Evides

    Evides MDL Member

    Joined:
    Apr 6, 2014
    Messages:
    114
    Likes Received:
    24
    Trophy Points:
    10
    #10 Evides, Mar 9, 2018
    Last edited: Mar 9, 2018
    Why bother pressing the powerbutton and just pull the powercord..? ;)
    Like shutting down the ignition on your car while still doing 65 on the highway...
     
  11. Ras0

    Ras0 MDL Novice

    Joined:
    May 7, 2012
    Messages:
    33
    Likes Received:
    15
    Trophy Points:
    0
    Easiest way imo win+x then press double U to shutdown, win+x then u->s to sleep.
     
  12. oldsh_t

    oldsh_t MDL Expert

    Joined:
    Dec 23, 2009
    Messages:
    1,073
    Likes Received:
    526
    Trophy Points:
    60
    Been using the power button shutdown since my XP days and have never had a problem. But now I don't use Win10 so that may be a problem??
     
  13. Enthousiast

    Enthousiast MDL Tester

    Joined:
    Oct 30, 2009
    Messages:
    35,567
    Likes Received:
    59,638
    Trophy Points:
    450
    Pushing the powerbutton for 4sec to shutdown is a hardware shutdown, windows never gets to power down so there will be problems when booting up again, also on older OS.
     
  14. oldsh_t

    oldsh_t MDL Expert

    Joined:
    Dec 23, 2009
    Messages:
    1,073
    Likes Received:
    526
    Trophy Points:
    60
    Well I am on win7 now and like I said no problems here.
     
  15. John Sutherland

    John Sutherland MDL Addicted

    Joined:
    Oct 15, 2014
    Messages:
    836
    Likes Received:
    1,247
    Trophy Points:
    30
    Doing a hard shutdown using the power button is never a good idea. The reason is that files that are cached in system memory don't get a chance to be written back to disk, resulting in data loss. This is why, when you update Windows and are asked to reboot, you see the message "Windows is installing updates: Do not turn off your computer". Bad things will happen if you don't follow that advice.
     
  16. dmex

    dmex MDL Junior Member

    Joined:
    Apr 20, 2011
    Messages:
    95
    Likes Received:
    105
    Trophy Points:
    0
  17. pcnavarra

    pcnavarra MDL Senior Member

    Joined:
    Nov 13, 2017
    Messages:
    305
    Likes Received:
    118
    Trophy Points:
    10
    Press the power button and just release it when the power led is off.

    :stereo:
     
  18. EXO56

    EXO56 MDL Member

    Joined:
    Mar 22, 2013
    Messages:
    149
    Likes Received:
    209
    Trophy Points:
    10
    @Enthousiast is right. Shutting down your computer using the button may cause problems
    i rarely use it. Only if there are no more options

    On older systems, ScanDisk was always triggered after an improper shutdown

    As @Enthousiast also, explained, holding down the button for 4 seconds & release it will forcibly shut down the hardware but will not preserve your computer from possible errors/corrupted files/unsaved work related to cutting power to Windows and not giving it the necessary time to properly exit runing applications and shut down itself.
     
  19. punder

    punder MDL Novice

    Joined:
    Mar 12, 2018
    Messages:
    9
    Likes Received:
    9
    Trophy Points:
    0
    The steps to add shutdown/restart buttons on your task bar are:

    1.Navigate to:C:\Users\[USERID]\AppData\Roaming\Microsoft\Windows\Start Menu\Programs
    2.Right-Click & select New -> Shortcut
    3.Type the location of the item: C:\Windows\System32\shutdown.exe /s /t 0 (This can be changed as shown above for Restart)
    4.Click Next
    5.Type a name for this shortcut: Shutdown NOW! (Restart Now)
    6.Click Finish
    7.Press Windows Key to return to Start Page
    8.Right-Click on the new tile
    9.Click Open file location
    10.Click Change Icon ( You'll see RED Shutdown, BUT, Tip - scroll across to find the Restart icon)
    11.Click OK when you get the error message.
    12.Click the Shutdown Icon
    13.Click OK
    14.Click Apply
    15.Click OK
     
  20. endbase

    endbase MDL Guru

    Joined:
    Aug 12, 2012
    Messages:
    4,522
    Likes Received:
    1,602
    Trophy Points:
    150