Sending commands from Ubuntu to Windows
Solution 1
You reminded me about winexe:
Download the tarball from the project page at http://sourceforge.net/projects/winexe/
wget "http://downloads.sourceforge.net/project/winexe/winexe-1.00.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fwinexe%2F&ts=1377024055&use_mirror=hivelocity"
I'm using a hot link for illustrative propose.
-
Untar the file:
tar zxf winexe*.tar.gz cd winexe*
-
Configure it:
./autogen.sh ./configure
-
Make it:
make
Then you can either install it, or running it with ./winexe
:
./winexe -U "Administrator" //some-pc 'shutdown.exe'
It follows the same syntax as psexec
Microsoft tool.
Solution 2
If you install cygwin on windows machines, and also install sshd, then you will be able to give any remote commands through ssh. From windows to linux you can give remote commands through putty (ssh).
Solution 3
Here are instructions for installation of Winexe, as summarised from http://www.aldeid.com/wiki/Winexe by Akisame (the quoted code snippets are copied verbatim from the original source):
For the people from the future I give thee the prerequisites (I had them except autoconf but it's a common problem so I'll just give them all).
sudo aptitude install build-essential autoconf checkinstall \ python python-all python-dev python-all-dev python-setuptools libdcerpc-dev
Next you use the autogen.sh
from source4 and follow the instructions from there on. When you're finished run
make basics bin/winexe
(this will take some time)
./bin/winexe -V
You should get "Version 4.0.0alpha11-GIT-UNKNOWN"
Related videos on Youtube
Akisame
Updated on September 18, 2022Comments
-
Akisame over 1 year
On our home network we have one Windows 7 only PC and several computers with Ubuntu 13.04 (dual boot with backup Windows 7 for programs that can't be run using wine).
We want to be able to send commands (like
msg
orshutdown
etc.) to that Windows PC (and if possible we want that Windows 7 PC to be able to send commands to the Linux PCs).How do I do this?
-
Lupen over 4 yearsYou've edited your question so that it now also includes an answer (which should have been posted as an answer). That makes the question harder to read and isn't how SE Question-and-Answer sites work so I've posted your answer as a real answer (community wiki so nobody gets the reputation).
-
Kulfy over 4 years@Akisame If you plan to post an answer on your own, please feel free to do so. Such things are highly encouraged :)
-
Akisame over 4 yearsooh wow.... This is a long time ago. This is my very first question on askubuntu. Back then I had to edit my question to answer people because I wasn't able to leave comments as a 1 reputation person.@Kulfy: I am good. but thanks for suggesting it. I don't really care about the reputation tbh
-
-
Lupen over 4 years
smbclient
doesn't allow arbitrary system commands to be run on remote MS Windows clients. It offers a limited set of internal commands (mostly related to file transfer), similar to an FTP client. -
Kulfy over 4 yearsGreat!!! Your edit is now accepted. On a side note please append your comment in the answer as a disclaimer. +1 from my side :)
-
Lupen over 4 years@Kulfy I've edited the answer to provide appropriate attribution and use quote formatting to highlight the text that was copied verbatim from the original source material.