How to Use NirCmd for Silent System Maintenance and Automation

Automate Windows Tasks with NirCmd: A Beginner’s Guide

NirCmd is a lightweight command-line utility for Windows that lets you perform many small but useful system tasks without writing full scripts or using the GUI. It’s ideal for automating repetitive actions like changing volume, manipulating windows, creating shortcuts, and controlling the clipboard. This guide shows beginner-friendly examples and practical workflows so you can start automating everyday Windows tasks quickly.

Getting started: download and setup

  1. Download NirCmd from the official developer site and extract nircmd.exe to a folder (for example, C:\Tools\nircmd).
  2. Add the folder to your PATH (optional) so you can run nircmd from any Command Prompt:
    • Open System Properties → Environment Variables → Path → Edit → New → add C:\Tools\nircmd → OK.
  3. Test it: open Command Prompt and run:

    Code

    nircmd.exe mediaplay 1

    (This example sends a “play” media key; if it runs without error, NirCmd is available.)

Basic command structure

NirCmd uses a simple syntax:

Code

nircmd.exe [arguments]

Examples below show commonly used commands and how to incorporate them into automation.

Useful beginner commands

  • Change system volume

    Code

    nircmd.exe setsysvolume 65535

    Sets volume to max. Use a value from 0 to 65535. To change by percentage, multiply 65535 by the desired percent.

  • Mute/unmute

    Code

    nircmd.exe mutesysvolume 1// mute nircmd.exe mutesysvolume 0 // unmute
  • Show/hide desktop icons

    Code

    nircmd.exe cmdwait 1000 sendkeypress lwin+d

    (Sends Win+D to show desktop; sendkeypress accepts multiple keys for shortcuts.)

  • Create a shortcut

    Code

    nircmd.exe shortcut “C:\Tools\nircmd\nircmd.exe” “C:\Users\Public\Desktop\NirCmd.lnk” “” “Run NirCmd” “C:\Tools\nircmd\nircmd.exe”
  • Turn off monitor

    Code

    nircmd.exe monitor off
  • Open URL in default browser

    Code

    nircmd.exe exec show “https://example.com”
  • Copy text to clipboard

    Code

    nircmd.exe clipboard set “Text to copy”
  • Move and resize window

    Code

    nircmd.exe win move title “Untitled - Notepad” 0 0 800 600

Combining commands into batch files

Create a .bat file to run a sequence of commands automatically. Example: morning routine.bat “` @echo off n

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *