Using NirCmd in combination with Launchy can provide for a serious boost in productivity on your Windows PC.
NirCmd is a freeware utility that allows you to perform tasks from the command line, via .bat files, desktop shortcuts and even Launchy. I’ve picked out a few that I’ve found useful, but you will undoubtedly find other NirCmd features that are even more helpful by reading through the big list of commands. This was written and tested in Windows 10 but it should also work in nearly every version of Windows.
Setup and Use NirCmd
To get started download NirCmd (the link is all the way at the bottom of the page). Next unzip the contents to a folder; I would suggest something simple such as C:\NirCmd\ if you use something else, substitute that wherever you see C:\NirCmd\ in this guide.
The simplest way to use NirCmd is in the command line, however this article will concentrate on writing commands out in a .bat file and using Launchy to run them. For a simple test, open up Notepad or your text-editor of choice and type or copy and paste the following text:
C:\nircmd\nircmd.exe monitor off
Save the file in your C:\NirCmd folder as MonitorOff.bat (the exact name doesn’t matter, but it should be descriptive). Now with MonitorOff.bat sitting in the C:\NirCmd folder, double-click it to put your monitor into power saving mode (you can move the mouse or hit a key to turn your monitor back on).
Next up is a useful desktop shortcut to mute and un-mute the sound. In a new file enter:
C:\nircmd\nircmd.exe mutesysvolume 2
Save the file in C:\NirCmd as MuteUnmute.bat and test it out by double-clicking it. You may want to have some music playing or a YouTube video open so you can confirm it’s working. The first time you run it your volume will mute. The next time you run it, the volume will unmute.
One last example before we jump into the Launchy integration – changing your screen resolution. Super easy. Fire up Notepad again and enter the text:
C:\nircmd\nircmd.exe setdisplay 2560 1080 32
but replace 2560 and 1080 with the resolution you want to use. Save it in C:\NirCmd as SetDisplay2560x1080.bat (or really, WhatEverYouWant.bat)
Then make another .bat file with another resolution you frequently use and save it in C:\NirCmd as well.
Now you can double-click either of these .bat files and your PC will instantly switch to that screen resolution.
Using NirCmd with Launchy
- In order to have Launchy recognize NirCmd and your .bat files you’ll have to add the C:\NirCmd folder to Launchy’s catalog. To do so, bring up Launchy and click the Options button (the one that looks like a cog, see screenshot below).
- First select the Catalog tab, then click the + (plus) button found under the Directories section.
- Navigate to the folder that contains NirCmd and all of your .bat files, select it and then click the OK button.
- Now make sure there’s a check in the box labelled Include Executables and then click the Rescan Catalog button.
- It shouldn’t take very long for Launchy to rescan its catalog. Once it’s done, exit out of the Options and bring up Launchy. Then type:
- It should find the MonitorOff.bat file before you finish typing. Hit Enter to run it and it will turn off your monitor. All of the other .bat files created in C:\Nircmd should also be accessible by typing their filename in Launchy.
- You can also enter a NirCmd command directly from Launchy. In the Launchy box type:
and then hit the Tab key. You should see an arrow and a blinking cursor after nircmd
- Now try entering one of the example NirCmd commands – I’ll use the one to open my DVD drive:
- This will eject your CD/DVD drive (assuming it’s assigned to the D: drive)
cdrom open d:
There are a lot of commands and examples to try out, especially since you can have multiple commands in a single .bat file. Try this quick set of commands to tidy up Windows and logoff (particularly good for a computer that has multiple users):
C:\nircmd\nircmd.exe clipboard clear
C:\nircmd\nircmd.exe exitwin logoff
Save this as Logoff.bat in C:\NirCmd\ and when you are ready, running it will empty the Recycle Bin, clear the clipboard and log off the current user. Be sure to only test this once you want to logoff as it will close all of your windows, including unsaved documents.
Note: Depending on your Launchy settings you may have to Rescan Catalog after making new .bat files or desktop shortcuts. This option is on the General tab on the bottom as Minutes between catalog updates. If you have it set to 0 which is for manual updates only, then you will have to rescan the catalog whenever you want new commands and shortcuts added to Launchy.
Be sure to check out our other guide on using Launchy to do stuff like search your Gmail, create site-specific searches, add text to files and more!