Re: Run an application from remote PC
- From: "Jon Springs" <jspringsATjontandsheDOTorg>
- Date: Tue, 29 Jul 2008 16:38:09 -0700
Here is an example of how to use psexec.exe to spawn a process on another
computer.
program ps;
{$APPTYPE CONSOLE}
uses
SysUtils,
Windows;
var
cmd : string;
processInfo : TProcessInformation;
startUpInfo : TStartUpInfo;
begin //main program code
cmd := 'psexec \\xx.xx.xx.xx -d -i -p password -u userid
c:\utils\list.com c:\log';
startUpInfo.cb := SizeOf( startUpInfo );
FillChar( startUpInfo, 0, SizeOf( startUpInfo ) );
if not CreateProcess( Nil, pChar( cmd ),
Nil, Nil, False,0, Nil, Nil,startUpInfo, processInfo ) then
begin
WriteLn( 'Could not create process' );
Exit;
end;
WaitForSingleObject( processInfo.hProcess, INFINITE );
end.
If you get psexec.exe and run it without parameters, it will explain the
options for you.
-----Jon-----
"Jon Springs" <jsprings@xxxxxxxxxxxxxx> wrote in message
news:488f3ff7$1@xxxxxxxxxxxxxxxxxxxxxxxxx
This works like a champ. I use it every day.
http://technet.microsoft.com/en-us/sysinternals/0e18b180-9b7a-4c49-8120-c47c5a693683.aspx
-----Jon-----
"Dean Hill" <none@xxxxxxxx> wrote in message
news:488ecc3c$1@xxxxxxxxxxxxxxxxxxxxxxxxx
I got an exe on a server PC.process
I would like to run this exe by ShellExecute from my machine but the
finally to be run as local process. Can I or how can I run this exe onthe
server?
You could perhaps shell to something like PSEXEC which is part of the Sys
Internals suite.
---
Dean
--- posted by geoForum on http://delphi.newswhat.com
.
- References:
- Run an application from remote PC
- From: Man T
- Run an application from remote PC
- Prev by Date: Re: TLabel with AntiAliasing , is possibile ?
- Next by Date: Re: Developing in virtual machine: Recommendations
- Previous by thread: Re: Run an application from remote PC
- Next by thread: What languages is Embarcadero's ER/Studio written in?
- Index(es):
Relevant Pages
|