Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've successfully connected to my Windows 7 desktop over wifi via Telnet from an XP Home netbook. To login, I use the following command:

telnet -l "win7desktop\win7user" win7desktop

win7user in this case is an Administrator on win7desktop and is also a member of the Telnet Clients Group.

The problem I have is that when I attempt to shut down win7desktop by issuing the following command:

shutdown /s the Telnet prompt, I get an Access Denied error:

Access is denied.(5)

Is it possible to shutdown a remote computer running Windows 7 via Telnet? If so, what do I need to do to get around the Access is denied error?

share|improve this question
You shouldn't use telnet, ever. All data, including login credentials, are sent in the clear. – Iszi Jun 3 '11 at 17:26
@Iszi unless you are on a closed network where that isn't an issue. – Rob Feb 16 '12 at 14:54
@Rob Unless said network is just a VM environment running on your own machine, and the VM network is not communicating with the host or other systems connected to the host, I wouldn't trust any network to be absolutely "closed" - especially one where credentials are being sent in the clear. – Iszi Feb 16 '12 at 15:10

Is it necessary to use telnet?

If not, you can use PsShutdown to shutdown a remote computer. Or, you can use PsExec and call the shutdown command.

psshutdown -u <username> -t 0 -k
psexec -d -u <username> shutdown -t 0 -s
share|improve this answer
If it's not possible with Telnet, I'll try one of these options, thanks. – Ryan Shripat Apr 20 '10 at 12:08

You're getting a permissions error. As I understand it, even users who are Administrators sometimes need to elevate privileges to run certain commands.

You should try running the shutdown command with runas (aka sudo for Windows):

runas /noprofile /user:Administrator shutdown /s
share|improve this answer
The win7desktop\win7user is an administrator on the target machine, do I therefore do runas /user:win7user ... ? Or do I need to explicitly say /user:Administrator ? (What would be the password for Administrator ?) – Ryan Shripat Apr 20 '10 at 12:10
I've tried this with both /user:Administrator and /user:win7user, both with the same access denied error.. – Ryan Shripat Apr 21 '10 at 13:02

There are certain cases where Shutdown.exe does not work:

  • The target computer has just restarted and is applying policies.

  • A shut down of the target computer is in progress or has already occurred.

  • The log on dialog box is open on the target computer.

  • An expected or unexpected shutdown dialog box is open on the target computer.

share|improve this answer
None of these apply in this instance.. – Ryan Shripat Apr 20 '10 at 12:08

To save others looking in future; I did all the Firewall, Local Security Policy guff, but no go. This is the real trick for Win 7.

Access is denied

  • All Windows flavors. The account you are executing the reboot command needs to be an Administrator on the machine that you are trying to reboot. If you want to execute the shutdown command as a different user, try psshutdown. The command will look like this when specifying a user (where -r is for reboot and -u is for the user)

    psshutdown -r -u roger

  • In Windows XP, you will have to have “Simple File Sharing” disabled. Otherwise you will get the error message “Win 32: Access is denied”. To disable simple file sharing launch a My Computer window.

    From Tools menu select Folder Options, go to the View tab and remove the check from “Use simple file sharing (Recommended)”.

  • In Windows 7 and Windows Vista, a small registry trick is needed. If you are getting the “Win32: Access is denied” message, launch a registry editor (on the machine that you want to remotely reboot).

    • Type regedit in the Run box
    • Go to HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionPoliciesSystem
    • Check the right side of the window to see if you have an entry for LocalAccountTokenFilterPolicy. If you do change its value to 1
    • If the entry does not exist, right click, select New > DWORD (32-bit) Value and name it LocalAccountTokenFilterPolicy. Then double click the new entry and change its value to 1
    • Reboot your machine
share|improve this answer

If you just typed shutdown -i in Windows 7 command prompt, then it prompts to remote shutdown dialog box.

It shows like a box containing

computer name : {add} 

and what you want this computer to do:

  • restart
  • logoff
  • shutdown
  • annotate unexpected shutdown

Then all you have to do is to fill it out.

share|improve this answer
shutdown /f /s


shutdown /f /r

Don't use /l.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .