18 Temmuz 2010 Pazar

Executing Applications on Remote Systems by using PsExec

Running an executable on a remote machine is a piece of cake when you know the credentials (username and password) of the remote machine. A telnet-replacement called PsExec , can be used to execute processes on remote systems without having to install a client application.

PsExec is a free tool in PsTools Suite v2.44 and can be downloaded from the link below.
http://download.sysinternals.com/Files/PsTools.zip
After downloading the tool set, you can use the following example to run a remote executable.

Think that you want to run an executable which is located in "MyFolder" in "D:" drive and the name of the file is "MyFile.exe". Also , you know that the IP of the remote computer is "10.0.0.8" and the credentials are "user" for username and "pass" for password.

According to the information given above, your command line should look like the following line;
psexec.exe \\10.0.0.8 -u user -p pass -c -f "D:\MyFolder\MyFile.exe"

-u : username in the remote machine
-p : password of the given user
-c : by using this switch, it copies the specified application in the specified location, to the remote system for execution.
-f : if file already exists on the remote system it overwrites the file.

Hiç yorum yok: