windows:run_windows_cmd_from_linux
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
windows:run_windows_cmd_from_linux [2019/12/04 22:47] – removed peter | windows: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. | ||
+ | |||
+ | |||
+ | 1. Use the preinstalled version. | ||
+ | |||
+ | * Download from [[http:// | ||
+ | * Unpack the bz2 file: # bunzip2 winexe-static-081123.bz2. | ||
+ | * Change mod to allow execute: # chmod +x winexe-static-081123. | ||
+ | * Make soft link in your / | ||
+ | |||
+ | 2. Compile from source. | ||
+ | |||
+ | * Install necessary packages (gcc, svn, *-devel....) | ||
+ | * Get sources from [[http:// | ||
+ | * Unpack the source file: # tar -xvjf winexe-source-081123.tar.bz2. | ||
+ | * Compile according to README file: | ||
+ | * cd to unpacked tar.bz2 sources. | ||
+ | * ./ | ||
+ | * ./ | ||
+ | * make proto bin/winexe. | ||
+ | * Compiled file will be located in wmi/ | ||
+ | * Install winexe: | ||
+ | * install -s wmi/ | ||
+ | |||
+ | |||
+ | To use it is very simple: | ||
+ | |||
+ | <code bash> | ||
+ | winexe -U foo -W WORKGROUP -n FOO-PC //10.0.0.61 " | ||
+ | </ | ||
+ | |||
+ | 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: | ||
+ | |||
+ | < | ||
+ | Microsoft Windows [Version 5.2.3790] | ||
+ | (C) Copyright 1985-2003 Microsoft Corp. | ||
+ | |||
+ | C: | ||
+ | </ | ||
+ | |||
+ | |||
+ | 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)