Restart the PC via the command prompt

GLX20 Posted messages 3 Status Member -  
brucine Posted messages 24836 Registration date   Status Member Last intervention   -

Hello,

I would like to restart my computer in the command prompt with the command "Shutdown /r".

But the following message appears: "Shutdown" is not recognized as an internal or external command, an executable program, or a batch file.

How can I restart or shut down the PC in this case?

Knowing that I am in the command prompt opened from WinRE.

Thank you in advance

6 answers

  1. brucine Posted messages 24836 Registration date   Status Member Last intervention   4 166
     

    Good evening,

    That's a good question, I’ve never thought about whether the SHUTDOWN command is available in the WinRE environment, but in principle, if WinRE is running (from an external media?), it means Windows is not running.

    Try, just in case, shutdown /r /m \\ComputerName or launch shutdown from the target PC, assuming it is indeed named C: under WinRE, to be verified via CD /D C:\Windows\System32

    0
  2. fabul Posted messages 42132 Registration date   Status Moderator Last intervention   6 061
     

    Hello,

    The normal command

    c:\windows\system32\shutdown -s -f -t 00

    0
    1. brucine Posted messages 24836 Registration date   Status Member Last intervention   4 166
       

      Hello,

      No, it's not about turning it off but about restarting it (and "t" is optional when it's null).

      0
      1. fabul Posted messages 42132 Registration date   Status Moderator Last intervention   6 061 > brucine Posted messages 24836 Registration date   Status Member Last intervention  
         

        Edit: c:\windows\system32\shutdown -r -f to restart

        If you don't include -t 00 it will restart in 1 minute instead of immediately

        0
  3. GLX20 Posted messages 3 Status Member
     

    Thank you for your replies.

    The problem is that Shutdown is not recognized as a command, as indicated by the message.

    So none of these possibilities work...

    0
  4. fabul Posted messages 42132 Registration date   Status Moderator Last intervention   6 061
     

    If you pressed the Power button for 5 seconds, it would expand.

    But I know, you're trying to understand, so am I.

    If you tried x:\ instead of c:\

    0
  5. GLX20 Posted messages 3 Status Member
     

    Exactly, it starts with X:\windows\system32 and not C:\

    0
  6. fabul Posted messages 42132 Registration date   Status Moderator Last intervention   6 061
     

    CD c:\windows\system32
    shutdown -r -f -t 00

    0
    1. brucine Posted messages 24836 Registration date   Status Member Last intervention   4 166
       

      Hello,

      The question is not about the syntax of the command; the one in the original message is correct, even if I suggested trying, as mentioned in <1>, albeit without much hope, to see WinRE address a drive with a different letter or to consider this drive (the Windows disk) as another PC.

      The point is that WinRE does not include shutdown itself and that, as I also pointed out in <1>, if WinRE is launched, it means that Windows is not running, making it impossible to close what is not open or even to access the DOS commands emulated by Windows.

      The secondary question is why WinRE (which should not be confused with specific operational Windows versions, such as IoT) is launched and why we would want to use it to shut down or restart the computer.

      1