Batch file for remote shutdown of Windows Server 2003

180 pts.
Tags:
Batch files
Microsoft Windows Server 2003
Remote shutdown
Windows Server Remote Access
Hi, I want to make a batch file and remotely shutdown a Windows 2003 Server. Is it possible?

Answer Wiki

Thanks. We'll let you know when a new response is added.

It is possible remotely shutdown Server 2003. but before doing that, the computer configured correctly.
Here are a couple of the most command to shutdown remotely:

  1. -l: Logs off the computer
  2. -s: Shuts down the computer
  3. -r: Restarts the computer
  4. -m \\computername: remote shutdown of a computer
  5. -f: Forces programs to close immediately and -t for time of interval

Open a file in notepad with .bat extension and write like that:
@echo off
shutdown -m \\<computername> -f (u may use ip address also)
Or you may try this…..

  1. Click Start>Run>Cmd
  2. On command prompt, type: shutdown -i
  3. There is a window called “Remote Shutdown Dialog”
  4. Click Add and insert the computer name which you want to shutdown remotely
  5. Now select Option and type a comment in “Comment” area

Press Ok.

Discuss This Question: 5  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • ninjas
    Hi Rechil, I am getting the error access denied. I want to make a batch file in which I can feed the user name and password (Administrator of the remote server) so the user can also shutdown the server. Is there any possibility for a normal user to shutdown the server? I don't want the user to RDP the server, just shut it down. Thanks
    180 pointsBadges:
    report
  • Subhendu Sen
    But you have to give proper permission to those users. Also is a good tool to shutdown remotely. It's called "tunnilier". Thanks!
    29,710 pointsBadges:
    report
  • carlosdl
    You could use the Sysinternals' PsExec tool to remotely execute the shutdown command with the ability to parameterize the machine to shutdown and the user and password. A bat file with this code should do what you want:
    echo off
    set /p pc=Machine:
    set /p user=User:
    set /P pass=Password:
    psexec \%pc% -u %User% -p %pass% shutdown -s -c "Some useful comment"
    70,220 pointsBadges:
    report
  • carlosdl
    The editor removed one slash from the last line. This is the correct command (I hope):
    psexec \\%pc% -u %User% -p %pass% shutdown -s -c "Some useful comment"
    70,220 pointsBadges:
    report
  • shanekearney
    open cmd prompt and type this shutdown -m \put in computer name or IP address -f this shuts down the computer if you want to shut down the computer remotely and get it to reboot type in shutdown -m \put in computer name or IP address -f -r -t 00
    810 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following