Shutdown / Restart

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

  1. Pasta88

    Pasta88 MDL Expert

    Jun 17, 2009
    1,332
    44
    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

    Nov 26, 2012
    3,396
    1,322
    120
    #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?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. tnx

    tnx MDL Expert

    Sep 2, 2008
    1,695
    267
    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

    Apr 6, 2014
    114
    24
    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. kaljukass

    kaljukass MDL Guru

    Nov 26, 2012
    3,396
    1,322
    120
    One small note: I recommend using / not -
    - used in XP and also in Vista, but the newer is /, although - works also.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. Pasta88

    Pasta88 MDL Expert

    Jun 17, 2009
    1,332
    44
    60
    Thx guys, they worked nicely.
     
  7. dmex

    dmex MDL Junior Member

    Apr 20, 2011
    95
    105
    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.
     
  8. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    47,233
    94,612
    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.
     
  9. Evides

    Evides MDL Member

    Apr 6, 2014
    114
    24
    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...
     
  10. Ras0

    Ras0 MDL Novice

    May 7, 2012
    33
    15
    0
    Easiest way imo win+x then press double U to shutdown, win+x then u->s to sleep.
     
  11. oldsh_t

    oldsh_t MDL Expert

    Dec 23, 2009
    1,081
    532
    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??
     
  12. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    47,233
    94,612
    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.
     
  13. oldsh_t

    oldsh_t MDL Expert

    Dec 23, 2009
    1,081
    532
    60
    Well I am on win7 now and like I said no problems here.
     
  14. John Sutherland

    John Sutherland MDL Addicted

    Oct 15, 2014
    867
    1,388
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  15. pcnavarra

    pcnavarra MDL Senior Member

    Nov 13, 2017
    296
    114
    10
    Press the power button and just release it when the power led is off.

    :stereo:
     
  16. EXO56

    EXO56 MDL Member

    Mar 22, 2013
    183
    250
    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.
     
  17. punder

    punder MDL Novice

    Mar 12, 2018
    9
    9
    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
     
  18. endbase

    endbase MDL Guru

    Aug 12, 2012
    4,671
    1,708
    150
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...