Skip to content

nircmd_screenshot.ps1

Corey Watson edited this page Dec 1, 2025 · 1 revision

nircmd_screenshot.ps1

Screenshot Capture using NirCmd.

Overview

Captures a screenshot of the current display using NirSoft's NirCmd utility. Downloads NirCmd if not already present, then saves a timestamped screenshot.

Purpose

This script automates the process of capturing screenshots on Windows systems using the NirCmd utility. It handles the download and setup of NirCmd automatically, making it ideal for remote screenshot capture via RMM platforms.

Prerequisites

  • Windows 10/11 or Windows Server
  • Internet access for NirCmd download
  • Write permissions to destination folder

Configuration

Required Inputs

  • $destinationFolder : Folder to store NirCmd and screenshots (default: C:\limehawk\nirsoft)
  • $screenshotFolder : Subfolder for screenshot files (default: C:\limehawk\nirsoft\screenshots)

Behavior

  1. Creates destination directories if they don't exist
  2. Downloads NirCmd (x64 or x86 based on OS architecture)
  3. Extracts NirCmd from zip archive
  4. Captures screenshot with timestamped filename
  5. Cleans up temporary zip file

Security Notes

  • Downloads from official NirSoft website
  • No secrets in logs
  • Screenshots saved locally only

Exit Codes

  • 0 = Success
  • 1 = Failure

Example Output

[ INPUT VALIDATION ]
--------------------------------------------------------------
Destination : C:\limehawk\nirsoft
Screenshot Dir : C:\limehawk\nirsoft\screenshots

[ DOWNLOADING NIRCMD ]
--------------------------------------------------------------
Architecture : x64
Download URL : https://www.nirsoft.net/utils/nircmd-x64.zip
Download complete

[ CAPTURING SCREENSHOT ]
--------------------------------------------------------------
Filename : screenshot_20241201-143022.png
Saved to : C:\limehawk\nirsoft\screenshots\screenshot_20241201-143022.png

[ FINAL STATUS ]
--------------------------------------------------------------
Result : SUCCESS

[ SCRIPT COMPLETED ]
--------------------------------------------------------------

Version History

  • v1.0.0 (2024-12-01) - Initial release - migrated from SuperOps

Links

Clone this wiki locally