Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have MacBook Pro with OS X 10.6.7 and I have a Windows XP machine. I want to restart the Windows machine through the OS X command line. For example in Windows we can restart with this command:

shutdown -m \\IP -r -t 00

It will be restarted immediately.

How can I do this with a Mac?

share|improve this question
1  
So you are wanting to know how to SSH via a mac to a windows machine so you can type the command you described? –  David Jun 20 '11 at 19:11
add comment

3 Answers

If you have Samba tools installed, you can do

net rpc shutdown -r -I <IP> -U <username>
share|improve this answer
    
Where do I get Samba tools? –  Tyilo Aug 21 '11 at 2:41
    
Samba tools have been removed from the system in Lion, but you can install them via homebrew: brew install samba Note, though, that it can conflict with Apple's proprietary smbd, and re-enables parameters in smb.conf –  Temikus Jul 27 '13 at 16:44
add comment

If your Windows box were running Windows Server, then you could RDP into a command-line only session and probably pipe the command shutdown -r -t 1 into the RDP session.

If your Windows box had an SSH server installed, then you could ssh in and do the same thing. I don't think there is another way--unless your Mac has a robotic arm attachment that could be controlled via the command-line to press the restart button on the XP box.

share|improve this answer
    
But I don't want to RDP can I do it from bash directly? or there is no solutions –  Codey Jun 21 '11 at 17:35
    
Well, there is something called "Services for Unix", or more recently, "Unix Subsystem" that Windows supports. It's a unix-like environment within Windows--but I think you'd still need an ssh server (or sim.) running to accept remote connections. –  jpaugh Jun 24 '11 at 22:50
add comment

You could just use the Windows RDP tool for Mac and RDP into your Windows XP machine and run the command,

shutdown -r -t 0

To restart the system without RDP then you can install an SSH Server (This forum thread could be of interest, but the link below includes the page to OpenSSH binaries for Windows anyway.) onto your Windows Machine and then simply accessing the Windows machine like:

ssh User@192.168.0.5

Will take you to the Windows command prompt, and I believe you could just run the Shutdown Command through SSH.

Here's a website I found, maybe you can make some sense out of it: http://www.tonyspencer.com/2005/12/03/restart-windows-remotely-through-vpn/

share|improve this answer
    
I know I can do it with RDP but is there another idea can connect to windows machine via bash? –  Codey Jun 21 '11 at 17:36
    
Changed my answer, hopefully it will help you further –  Sandeep Bansal Jun 21 '11 at 19:04
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.