Thursday, April 14, 2011

Winexe: To run code on windows machines from Linux

The instructions on this post are a summary of information collected from this link. And I made some changes to it as well

These are instructions of how to get winexe working on Ubuntu 10.04.1 LTS system

To begin with make sure your system has the required libraries:
sudo apt-get install build-essential autoconf checkinstall

You will also need the python development libraries and header files:
sudo aptitude install python python-all python-dev python-all-dev python-setuptools

Now get the source code of winexe using svn. And apply the first patch:
svn co
cd source
patch -p0 -i fix_winexe_service.diff

Now there is bug in the source/winexe/service.c file:
replace file


Save,close and you are ready to compile:
cd source/
make proto bin/winexe
sudo cp bin/winexe /usr/local/bin/

and now you can test that that winexe is working correctly by doing:
winexe -W WORKGROUP -U Administrator%SecretPassword // 'cmd.exe'