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.
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.
MonitorOff
nircmd
and then hit the Tab key. You should see an arrow and a blinking cursor after nircmd
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 emptybin
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!
View Comments
I just configured launchy to use the killprocess command, on a window I specify in launchy.
I used the 'runner' plugin for this.
I entered:
"C:\WINDOWS\system32\nircmd.exe"
and
" killprocess $$.exe"
By using this, i can pretty much do anything, istead of having to write a new batch file for every variable i need changed.
(oh, and btw, the reason why I put nircmd in system32, is because I can run nircmd command easier from 'run', without having to type where it is stored).
Good tutorial, but is there any way to Switch User? Launchy itself will only allow you to Log Off so hoping NirCmd can add this.
hey great even works with my launch app called key launch but i can only get monitor off and empty recycl;e bin to work any reasons why i cant get the resolution one to work and can you put more on ;)
Great tuto man!!
Thanks!