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
Related videos on Youtube
Author by
user7365010
Updated on September 18, 2022Comments
-
user7365010 almost 2 years
I know we can reboot windows with
shutdown /r /t 0
command, but is there any way to restart just runningreboot
on Run?-
Akina almost 6 yearsCreate the
reboot.bat
file with proper command(s) and place it into any folder which presents in PATH environment variable.
-
-
user1686 almost 6 yearsYou 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 almost 6 yearsHowever, 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 almost 6 yearsYes, I can see the issue. I will edit my answer accordingly.