The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

Launching a process on a remote Windows machine

I'm looking for ways to start a process on a remote Windows machine.  I know of a few but am wondering if there are others:

1. Copy a service to the remote machine, remotely register it, remotely start it, tell it what to launch

2. WMI?

3. AT command?  (is there an API for it?)

4. Task Scheduler (can you access it remotely?)

Naturally administrator credentials would be needed.

Any other ideas, or does anyone know how the AT command works?
Doug
Monday, March 17, 2008
 
 
Check out sysinternals (now microsoft) psexec.
John C.
Monday, March 17, 2008
 
 
DCOM... or have a remote "launcher" running on the remote machine as a service or loaded on startup, and have it just sit there waiting to be told what to launch.
John
Monday, March 17, 2008
 
 
sysinternals has a psexec tool
Martin Send private email
Monday, March 17, 2008
 
 
Cade Roux Send private email
Monday, March 17, 2008
 
 
+1 for psexec. I've used it numerous times for exactly what you're looking for. It is very powerful and can even copy the executable to the remote machine (using the -c switch) and then execute it. Program output and return codes (errrorlevel) can be captured locally which is also helpful.
Rich
Monday, March 17, 2008
 
 
That's true, psexec works well in many situations.  You can even "automate" the local client process (psexec) from an application via the StdIO streams, and thus the remote process as well.  This gives you full I/O interaction, not just output capture.
So tired
Tuesday, March 18, 2008
 
 
There is also WSH's Execute method and WshRemote object.
Codger
Tuesday, March 18, 2008
 
 
Here is another way of doing...

Push and Run .NET Code on Remote Machine
http://www.codeproject.com/KB/IP/run_code_remotely.asp

Do you want to reveal your purpose, to let us help you find the best way of doing it, or r u just looking for ways to hack another machine :-)
ThMoJe
Tuesday, March 18, 2008
 
 
I'm have a monitoring program that could run some fixes if it could launch a remote app.

I took a look at PsExec using DependencyWalker.  Based on the exports it uses, it appears it probably copies itself remotely, registers itself as a service remotely, starts itself, and then talks to itself to launch whatever the target is.  I'll know more when I register for WindowsIT Pro magazine so I can read the article about the implementation (have to pay $40 just to read a 4 year old article!)

Basically I'm looking for the technology that will work in the most situations, always with administrator rights, and requires the least of my end users (no DCOMCnfg, firewall settings, etc, etc). 

Guess I need to roll my own version of PsExec :(  Wonder if there are any components like this for sale to a commercial entity?
Doug
Tuesday, March 18, 2008
 
 
In case anyone is wondering, my guess was correct (I subscribed so I could read the two paragraphs describing how it works).

I was debating whether I can just copy and paste part of the article or if that would be against copyright. 

The long and the short of it is a service copied to $admin share, registered, and started.  Service listens for commands on a named pipe from psexec and processes commands sent to it.

Naturally the devil is in the details, but no more detail than that is revealed.  Wish the source was public domain.
Doug
Tuesday, March 18, 2008
 
 
@ThMoJe

Thanks for that article.  It describes exactly the same steps that PsExec is using, but with a .NET service.  Look like that must be the way to do it.
Doug
Tuesday, March 18, 2008
 
 
Provided that the program you wish to start already exists on the remote computer at a known location, both the AT command and the Task Scheduler (accessed via the SchTasks command) can be used for this purpose. I have used the latter.
Raj Chaudhuri Send private email
Wednesday, March 19, 2008
 
 
On reading your post again, it seems that you would like to do this programmatically. In that case, I receommend (based on personal use again) WMI.
Raj Chaudhuri Send private email
Wednesday, March 19, 2008
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
 
Powered by FogBugz