Execute Applications on Remote Systems
Environment: NT4 SP6, Win 2000 SP1, Visual C++ 6.0
Overview
This program allows you to execute applications on remote systems without
installing any client software. You can start a command prompt or just execute a
command or exe on a remote machine. The only restriction is you must be an
administrator :(
Everybody knows the cool tools from Sysinternals (www.sysinternals.com). One
of my favorites are PSEXEC, PSKILL and PSLIST,... :)
I was always wonder how they could query every kind of information or execute
commands on a remote machine without installing any client software.
Features
- With this program you can run as many remote commands on the remote machine as you want. (PSEXEC supports only one remote command on the remote machine at the same time)
- You can execute internal commands (dir,..) directly.
xCmd.exe \\remote dir - You can start a light "telnet" connection with a remote machine
without any telnet server
xCmd.exe \\remote cmd
Usage
xCmd v1.0 for NT4/2000 - executes commands remotely
Freeware! 2001 Zoltan Csizmadia, zoltan_csizmadia@yahoo.com
Usage: xCmd.exe \\computer [options] command/exe arguments
Options:
/D:directory
Set working directory
Default: Remote "%SystemRoot%\System32"
/IDLE
Idle priority class
/NORMAL
Normal priority class
/HIGH
High priority class
/REALTIME
Realtime priority class
/C
Copy the specified program to the remote machine's
"%SystemRoot%\System32" directory
Commands's exe file must be absolute to local machine
/USER:user
User for remote connection
/PWD:{password|*} Password for remote
connection
/NOWAIT
Don't wait for remote process to terminate
Examples:
xCmd.exe \\remote cmd
xCmd.exe \\remote /user:administrator dir c:\
xCmd.exe \\remote /user:somebody /pwd:* /d:d:\ test1.exe
/p1 /p2
xCmd.exe \\remote /c /user:somebody /pwd:* /d:d:\ test2.exe
/whatever
- Input is passed to remote machine when you press the ENTER.
- Ctrl-C terminates the remote process
- Command and file path arguments have to be absolute to remote machine
If you are using /c option, command exe file path must be absolute to
local machine, but the arguments must be absolute to remote machine
How does it work?
- The xCmd.exe is console application and when you start it, the program will extract a xCmdSvc.exe from its resources.
- xCmd.exe creates a service on the remote machine (that's the reason, you must be an administrator
- xCmd.exe starts the remote service (#2)
- xCmd.exe and xCmdSvc.exe will communicate via named pipes
- xCmd.exe send a packet to the service what to execute
- xCmdSvc.exe starts the command and redirect stdout, stderr, stdin to 3 named pipes.
- xCmd.exe listens these 3 named pipes (#6), redirect them to its stdout, stderr, stdin
Notes
The executable is compiled and linked on Windows 2000 SP1, VC++ 6.0 SP4 and
in multithreaded DLL mode.
So if you get some errors, rebuild your executable from the source (xCmd.dsw).

Comments
problem with console output
Posted by yugiru on 06/25/2007 07:23pmGreat program!! I have a little problem here. If I try to run a not pre-installed program/service on the remote machine(I wrote the program myself, just some console.write commands), I cannot see the console output from my local machine. Do you have any idea why?
ReplyNew version posted
Posted by Rischip on 05/17/2007 12:32amThe new version is on sourceforge.net. The project is "thegrimlinker" the download for the newest version is "ReXeCutioner"
ReplyProblem with GUEST user
Posted by Revolution on 07/11/2006 03:05amHi everyone, When i try to use it in the XP SP2 machine the service could not able to start.If i change FORCEGUEST policy then the service starts. Have any solution this problem? please help.......
ReplyxCmd Now working with GUI apps and running as user credentials
Posted by Rischip on 02/07/2006 05:52pmI have added the functionality to run remote GUI apps using a new /interactive switch. Also run apps under the user credentials you provide on the command line (or /system switch will run as system account). This will allow you to have network access from the launched application. One thing to note using this approach; login scripts don't run when logging in this way. So drive mappings will most likely not exist. Also I can access UNC paths (i.e. \\server\share), but have not yet gotten NET USE syntax to work. Thanks to Zoltan Csizmadia for such good code to work with. Also thanks to Microsoft for some of the code I borrowed off of the MSDN library site. Email me at Edit 10/25/06 SORRY TOO MUCH SPAM@gmail.com to help me beta test. Added 4/19/06: These changes were added and are compatible specifically for users on a domain type setup. Not a work group. I am going to try and setup a project for this mod'd version on sourceforge.net 5/16/07: Look at "thegrimlinker" project on sourceforge.net. Go to downloads and download "ReXeCutioner" This is the newest version.
-
-
-
-
Replythanks
Posted by MALEKY89 on 03/24/2010 01:51pmi read your code very nice code
ReplyNew version posted
Posted by Rischip on 05/17/2007 12:31amThe new version is on sourceforge.net. The project is "thegrimlinker" the download for the newest verision is "ReXeCutioner"
ReplyxCmd Now working with GUI apps and running as user credentials
Posted by Pippo BIMBO on 01/29/2007 06:25amHi Rischip, Can you please share your xcmd with the intercative switch function please? TIA Thierry
ReplyRe:xCmd Now working with GUI apps and running as user credentials
Posted by Jemboy on 02/08/2006 02:35amDear Rischip, could you please share your Xcmd with the interactive switch function?
Replyproblem with users
Posted by machinito on 05/10/2004 06:32amTo start an application in a remote machine you need to log in as an administrator, but when you remotely execute an application (ie. Internet Explorer) the task doesn't appear on the user screen but it appears on the task manager. What's wrong?
-
ReplyRE: problem with users
Posted by kevmy21 on 12/12/2005 06:42pmThe task will not display on the user's screen because it is being run in system space. The username you provide is only used to create a remote service. All services run in system space and do not display gui to users. The remote service executes the task.
Replyremote GUI
Posted by Legacy on 02/18/2004 12:00amOriginally posted by: David Liouville
Please could you give us a source code wich work with GUI applications ? built xCmd.exe with SERVICE_INTERACTIVE_PROCESS does nothing, wrong synthax ?
ReplyPlease help ...
Problem with longer parameter for xcmd //server net start "Apache Tomcat 4.1"
Posted by Legacy on 12/15/2003 12:00amOriginally posted by: Marian
Hi Gugus,
I wave litle bit triky problem when I'm trying to use xcmd utility.
I need it for stoping and starting services on remote machine in batch.
xcmd works perfect when the name of the service has name without spaces (e.g. telnet...), but my problem had started, when I needed stop and start service named "Apache Tomcat 4.1". I used:
xcmd //server net start "Apache Tomcat 4.1"
and I get eror:
NET START service
I mean that xcmd sent command "net start + something"
May pls. somebody help me get over this?
What is triky, when I used it for first time it worked, but this was for first and last time.
Best regards,
Marian
ReplyWindows XP Home Edition
Posted by Legacy on 12/05/2003 12:00amOriginally posted by: Eric Solinas
Hi,
Is this program suppose to work for accessing a Windows XP Home Edition computer?
Thank's
Eric
Replycan't execute batch files
Posted by Legacy on 11/26/2003 12:00amOriginally posted by: Alfonso
ReplyPassword Prompt Not Working Properly When Using Net Use Command
Posted by Legacy on 11/20/2003 12:00amOriginally posted by: Tester
-
Replypassword
Posted by oli730 on 05/07/2004 05:27amI have the same problem. If you solved your problem, please send me a mail on oliver@cit.kg.ac.yu. Thank you so much.
ReplyLoading, Please Wait ...