Running executable applications remotely is really simple as long as you know the credentials of the remote workstation you want to run it on.
So how would you do that?
Through the use of PsExec. So what is PsExec? PsExec is a telnet-replacement that lets you execute processes on other systems without having to installing a client software. PsExec is free and can be downloaded here.
Once you downloaded it you can easily run command prompt from that directory.
To give you an example lets say I want to run a console application located at “D:MyApplications” named “MyExecutable.exe” at the workstation which has the IP “10.10.1.255”. Now the username for that workstation is “user” and the password is “pass”.
So the command for it will be :
psexec.exe \10.10.1.255 -u user -p pass -c -f "D:MyApplicationsMyExecutable.exe"
So what does the switches mean?
-u : send the username where the application will run as.
-p : that’s the password of that user.
-c : by using this switch, it copies the specified program in the specified location to the remote system for execution.
-f : if file already exists on the remote system it still copies and overwrites it.
So with a little bit of imagination you can do lots with it like performing command line commands remotely or you can even run it from a C# or VB.Net application.
Dim sShellCommand = "c:PsExecpsexec.exe \10.10.1.255 -u user -p pass -c -f ""D:MyApplicationsMyExecutable.exe""" Shell(sShellCommand, AppWinStyle.Hide)
System.Diagnostics.Process oProcess = new System.Diagnostics.Process(); oProcess.EnableRaisingEvents = false; oProcess.StartInfo.FileName = "c:\PsExec\psexec.exe"; oProcess.StartInfo.Arguments = "\\10.10.1.255 -u user -p pass -c -f "D:\MyApplications\MyExecutable.exe""; oProcess.Start();
So if you want to know what are the other switches just type PsExec and you will see all switches you might need