How to Integrate NirCmd with Launchy to Increase Productivity

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.

unzipping a file in Windows

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

a Notepad window with the 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).

an arrow pointing to a .bat file in a Windows File Explorer panel

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

a Notepad window with the text 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)

a Notepad window with the text c:\nircmd\nircmd.exe setdisplay 2560 1080 32

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

  1. 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).
  2. the Launchy Options button

  3. First select the Catalog tab, then click the + (plus) button found under the Directories section.
  4. the Catalog tab of the Launchy Options with an arrow pointing to a Plus button

  5. Navigate to the folder that contains NirCmd and all of your .bat files, select it and then click the OK button.
  6. selecting a folder in Windows

  7. Now make sure there’s a check in the box labelled Include Executables and then click the Rescan Catalog button.
  8. an arrow pointing to a check box and a second arrow pointing to a Rescan Catalog button

  9. 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:
  10. MonitorOff

    Launchy with the command MonitorOff entered

  11. 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.
  12. You can also enter a NirCmd command directly from Launchy. In the Launchy box type:

    nircmd

    and then hit the Tab key. You should see an arrow and a blinking cursor after nircmd

  13. Launchy with nircmd entered

  14. Now try entering one of the example NirCmd commands – I’ll use the one to open my DVD drive:
  15. cdrom open d:

    Launchy with the commands nircmd and cdrom open d

  16. This will eject your CD/DVD drive (assuming it’s assigned to the D: drive)

Additional Tips

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!


If this article helped you, I'd be grateful if you could share it on your preferred social network - it helps me a lot. If you're feeling particularly generous, you could buy me a coffee and I'd be super grateful :)

buy a coffee for simplehelp.net


Home » Windows » How to Integrate NirCmd with Launchy to Increase Productivity

4 thoughts on “How to Integrate NirCmd with Launchy to Increase Productivity”

  1. 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).

  2. 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.

  3. 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 ;)

Leave a Comment

Your email address will not be published.