Monday, 5 November 2012

Take a screenshot of a remote computer with psexec and nircmd


psexec, nircmd and Windows


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.


Download psexec from, download nircmd from
psexec.exe \\ -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 \\ -u "domain\administrator"  -i -c nircmd.exe savescreenshot "c:\shot.png"
Save 20 screenshots every minute in a loop:
psexec.exe \\ -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 \\ -u "domain\administrator" -p "password" cmd


  1. I keep getting "nircmd.exe exited on (remote PC's IP) with error code 0."

    I manually copied over nircmd.exe to %WinDir% of the remote PC, but then the command failed with "File already exists."

    What could be the problem? Thanks!

  2. Never mind, figured it out: error code 0 = success

    Important to note that c:\shot.png is saved to the hard drive of the remote PC, and the logged in user must have local admin rights to be able to write to C:

  3. I am glad that you figured it out. Btw. domain\administrator has local admin rights, so there is no problem saving to the C: drive.

  4. I'm getting a black screen, but when I run it locally on remote machine it works fine.

  5. you should use impressionate in the pstools parameters as the users differ and you are trying to get the screenshot of a non-interactive session thats why its blank

  6. @Tuwi D , or anyone....
    I have the black screen screen capture issue. How do you use the impressionate feature of pstools? I tried using the flag -i but I still have the black screen issue.

    Thanks in advance.

    1. Got it working.... I had to user this:

      psexec.exe -s -i \\ nircmd.exe savescreenshot "C:\shot.png"

    2. Btw, thanks OP of this article!!!!