User Tools

Site Tools


windows:run_windows_cmd_from_linux

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
windows:run_windows_cmd_from_linux [2019/12/04 22:47] – removed peterwindows:run_windows_cmd_from_linux [2020/07/22 14:53] (current) – old revision restored (2017/04/04 10:00) 92.220.10.100
Line 1: Line 1:
 +====== Windows - Run windows cmd from linux ======
 +
 +To run windows cmd from linux box, there is one tool you could use, which is winexe.  You can download the installer from [[http://eol.ovh.org/winexe/|here]].  There are 2 ways to install this tool:
 +
 +
 +1.  Use the preinstalled version.
 +
 +  * Download from [[http://eol.ovh.org/winexe/winexe-static-081123.bz2|here]].
 +  * Unpack the bz2 file: # bunzip2 winexe-static-081123.bz2.
 +  * Change mod to allow execute: # chmod +x winexe-static-081123.
 +  * Make soft link in your /usr/local/bin: # ln -s winexe-static-081123 /usr/local/bin/winexe.
 +
 +2.  Compile from source.
 +
 +  * Install necessary packages (gcc, svn, *-devel....)
 +  * Get sources from [[http://eol.ovh.org/winexe/winexe-source-081123.tar.bz2|here]].
 +  * Unpack the source file: # tar -xvjf winexe-source-081123.tar.bz2.
 +  * Compile according to README file:
 +    * cd to unpacked tar.bz2 sources.
 +    * ./autogen.sh.
 +    * ./configure.
 +    * make proto bin/winexe.
 +  * Compiled file will be located in wmi/Samba/source/bin/winexe.
 +  * Install winexe:
 +    * install -s wmi/Samba/source/bin/winexe /usr/local/bin/winexe.
 +
 +
 +To use it is very simple:
 +
 +<code bash>
 +winexe -U foo -W WORKGROUP -n FOO-PC //10.0.0.61 "cmd.exe"
 +</code>
 +
 +where:
 +
 +  * **-U** for username.
 +  * **-W** for workgroup.
 +  * **-n** for target machine netbios name.
 +  * **10.0.0.61** is the ip address of the target machine.
 +  * **cmd.exe** is to start the windows command prompt.
 +
 +Once connected, you will get command prompt like below:
 +
 +<code>
 +Microsoft Windows [Version 5.2.3790]
 +(C) Copyright 1985-2003 Microsoft Corp.
 +
 +C:\WINDOWS\system32>
 +</code>
 +
 +
 +To quit, just type **exit** at the windows command prompt.
  
windows/run_windows_cmd_from_linux.1575499623.txt.gz · Last modified: 2020/07/15 09:30 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki