Running winexe on the Mac

Aug 31, '11 07:30:00AM

Contributed by: yaxzone

If you are a Unix admin and also have to maintain Windows servers, you will find winexe a must command line utility to have in your arsenal.

Until recently I have been able to do this only on Linux boxes. I have compiled it and it works great however, on Mac OS X I have not had any luck until a few days I came across this site. There are also links provided to the winexe binary packages here.

So, once you install it, the usage is simple:

Here is a quick exemple.

To get the route table on the Windows machine (using your correct IP address and other appropriate information):

winexe -U YOURDOMAIN/YourAccount%YourPassword //172.16.2.xxx 'route print'

If you want to start a Windows service:

winexe -U YOURDOMAIN/YourAccount%YourPassword //172.16.2.xxx 'net start "Service Name"'

Or to kill a Windows service:

winexe -U YOURDOMAIN/YourAccount%YourPassword //172.16.2.xxx 'Process.exe -k 1110'

[crarko adds: I haven't tried this, but the first link will get you to the source code (GPL) so you can examine and build it for yourself. The second link points to a number of useful tools you can run in Terminal to work with Windows machines. I did a quick check of MacPorts and Fink and they didn't seem to have winexe, at least not as a standalone package.]

Comments (3)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20110804182651898