Can windows reboot command shutdown /r /t 0 link to command reboot?

18,720

You could create a .bat script containing the command(shutdown -r -t 0), save it as reboot.bat and then place it somewhere suitable on your system. If the location is not already in PATH, add it to PATH using the command below. This will work when using it in CMD. For use with RUN, see grawity's comment below.

set PATH = %PATH%;C:/Directory/Where/You/Saved
Share:
18,720

Related videos on Youtube

user7365010
Author by

user7365010

Updated on September 18, 2022

Comments

  • user7365010
    user7365010 almost 2 years

    I know we can reboot windows with shutdown /r /t 0 command, but is there any way to restart just running reboot on Run?

    • Akina
      Akina almost 6 years
      Create the reboot.bat file with proper command(s) and place it into any folder which presents in PATH environment variable.
  • user1686
    user1686 almost 6 years
    You can skip the latter part and use your "user profile" folder C:\Users\lcsncm – it works because it's the "current folder" as far as Explorer is concerned, so it gets checked even before %PATH%.
  • user1686
    user1686 almost 6 years
    However, I don't think your example command will do much good. Environment variables of a child process (CMD) don't automatically propagate to the parent process (Explorer). To actually update %PATH% such that it would work with Run, you would need to set it in the registry to be applied at logon time.
  • ddybing
    ddybing almost 6 years
    Yes, I can see the issue. I will edit my answer accordingly.