Monday, April 14, 2014

Take a screenshot of a remote computer with psexec and nircmd

 



What:

psexec, nircmd and Windows

Problem:

Take a screenshot of a remote computer in your network and save it to selected location. Optionally save 20 screenshots every minute in a loop.

Solution:

Download psexec from http://live.sysinternals.com/, download nircmd from http://www.nirsoft.net
psexec.exe \\192.168.1.10 -u "domain\administrator" -p "password" -i -c nircmd.exe savescreenshot "c:\shot.png"
shot.png will be saved on target computer

If you are logged on as administrator then you can skip -u and -p options, you can skip only -p then you will be prompt for a password.
psexec.exe \\192.168.1.10 -u "domain\administrator"  -i -c nircmd.exe savescreenshot "c:\shot.png"
Save 20 screenshots every minute in a loop:
psexec.exe \\192.168.1.10 -u "domain\administrator" -p "password" -i -c nircmd.exe loop 20 60000 savescreenshot "scr~$currdate.MM_dd_yyyy$-~$currtime.HH_mm_ss$.png"

Gain access to remote pc via console (telnet equivalent):
psexec.exe \\192.168.1.10 -u "domain\administrator" -p "password" cmd