Batch file to restart computer windows 7
Step 2 : The second step is to turn on File and Printer Sharing and to allow it through the Windows firewall. Click on the Change advanced sharing settings link in the left menu and select the radio button for Turn on network discovery and Turn on file and printer sharing. Go back to the main Control Panel window and click on Windows Firewall. Click on the Allow a program or feature through Windows Firewall in the left menu. You do not need to allow anything else through the firewall.
Step 3 : Lastly, if you are trying to target a Windows Vista, Windows 7 or Windows 8 computer remotely, you will need to modify the registry. You will only get the Access is Denied message no matter what. Open the registry editor by going to Start and typing in regedit. Now navigate to the following key:.
A new value will pop up at the bottom in the right window and the text will be highlighted. Now double-click on it and change the value from 0 to 1. Click OK and close out of the registry. This registry key is needed because in Windows Vista and higher, an administrator account is stripped of its credentials when connecting remotely. This will allow the account to remain with administrative privileges. You can do that by going to Control Panel and then clicking on System.
The shutdown command is most flexible when using it from the command prompt because you can add a bunch of switches to it, which allow you to customize the behavior.
You have to use at least one switch in order for the command to do anything. So for remotely shutting down another machine on your network, you would type into the command prompt the following commands:. This command will restart the computer named computername and force all programs that are still running to close. This command will shutdown the computer named computername , force all programs that are running to close, show a message to the user and countdown 60 seconds before it shuts down.
See my Terminal Server Commands page for the exact syntax. Credits: Steven Clements posted on alt. Learn how to shutdown a remote Windows computer. Shutdown in 10 seconds, close without saving.
See Reboot NT on my Solutions found in alt. Poweroff for ATX boards only, otherwise normal shutdown 3. Win various results, usualy fast shutdown and lock PC , sometimes restart Windows, sometimes reboot.
Win Restart Windows, sometimes reboot. Warm boot, sometimes cold boot. COM instead. Kills all running processes immediately without confirmation, resulting in a "Blue Screen Of Death".
Forcing applications to close. Use 0 instead of 1 if you don't want to force applications to close. Power off with prompt to close applications. Use SetSystemState 3, 1 to close applications without prompting.
Your email address will not be published. July 10, at pm. James Way says:. September 6, at am. Because this article is useless. The author is having you write the script store it on the target pc and run the bat file remotely on the pc so it can reboot itself.
That or if you want to execute the script remotely, you can use psexec, not the preferred method, or powershell remote sessioning. Jeremy Molina says:.
0コメント