NirCmd is een freeware nut dat u toestaat om taken van de bevellijn uit te voeren, .bat dossiers, Desktopkortere weg en zelfs Launchy. Er is een grote lijst van bevelen op de website NirCmd. Ik heb enkelen uitgekozen die ik nuttig heb gevonden, maar u kunt een ander groot gebruik voor NirCmd na lezing door de voorbeelden vinden. Dit werd geschreven en werd getest in WindowsXP maar het zou ook in andere versies van Vensters moeten werken.
Krijgen begon download NirCmd, is de verbinding al manier bij de bodem van de pagina. Rits daarna de inhoud aan een omslag open; Ik zou iets eenvoudig zoals voorstellen C:\NirCmd\ als u iets anders gebruikt, substituut dat waar u ziet C:\NirCmd\
Nota: NirCmd kan als virus tonen, spyware, of het potentieel ongewenste programma over sommige anti-virus en anti-anti-spywareprogramma's (Sophos is één) dit is omdat bepaalde virussen en spyware en NirCmd omvatten gebruiken om acties betreffende gebruikersPC uit te voeren. Nochtans het ook eveneens gebruikt=wordt= door vele goede programma's, zoals UBCD (die ik) kan later behandelen, en alleen stelt het geen risico.
De eenvoudigste manier om NirCmd te gebruiken is in de bevellijn, nochtans zal dit artikel op de uitschrijving van bevelen in een dossier en het gebruiken van Desktopkortere weg en Launchy om hen in werking te stellen de nadruk leggen. Voor een eenvoudige test, stel open Notepad of uw tekst-redacteur van keus en type in (of exemplaar en deeg):
C:\nircmd\nircmd.exe monitor weg
Sparen het dossier in uw C:\NirCmd\ omslag zoals MonitorOff.bat de nauwkeurige naam is niet van belang, maar het zou moeten beschrijven wat het doet.
Nu zou u moeten hebben MonitorOff.bat het zitten in C:\NirCmd\ omslag, tweemaal klikken op het om uw monitor in macht - sparen wijze (u kunt de muis bewegen of een sleutel raken om het terug te draaien) te zetten. U kunt een kortere weg aan MonitorOff.bat op uw Desktop dan plaatsen, om dit te doen Klik met de rechtermuisknop aan op MonitorOff.bat en uitgezocht Verzend naar en klik Desktop (cre�ër Kortere weg). Een andere methode die ik heb gehouden van om te gebruiken is eenvoudig te selecteren MonitorOff.bat met een enig-klik onderdruk dan Alt en sleep het dossier op de Desktop.
Als u zorgvuldig in bovengenoemde screenshot kijkt, zult u een andere opmerken .bat titled dossier wait2 screenshot.bat dit één is een reeks van twee bevelen om twee seconden te wachten en dan een screenshot te nemen die zoals wordt bewaard shot.png in C:\Nircmd dit komt in handig om een screenshot te vangen wanneer u niet alleen kunt raken CTRL + het Scherm van de Druk which I what I normally use for screenshots. Here is what the file contains:
C:\nircmd\nircmd.exe cmdwait 2000 savescreenshot “C:\Nircmd\shot.png”
Next up is a useful desktop shortcut to mute and un-mute the sound. In a new file enter:
C:\nircmd\nircmd.exe cmdshortcut “~$folder.desktop$” “Mute Unmute” mutesysvolume 2
Save the file in C:\NirCmd as Mute Unmute.bat you can also call change the “Mute Unmute” above in quotes to something else (the example on the website has “Switch Volume”), this will change the name of the desktop shortcut, you can also change any shortcut name later by right-clicking on it and selecting Rename. Now double-click on Mute Unmute.bat to create a new shortcut on your desktop that should mute the sound the first time it is double-clicked and un-mute it the next. If the default icon for this is too boring for you, right-click the Mute Unmute shortcut on your desktop and select Properties, select the Shortcut tab on top and click the Change Icon button. I personally like the speaker and music note icon as seen in the screenshot below.
The question that originally led me to NirCmd was someone wanting a quick way to switch resolutions, as she wanted a lower resolution for older programs. For this example I will use 800×600 with 32 bit colors as the lower resolution and 1280×1024 with 32 bit colors as the higher resolution, although you can substitute other resolutions such as 1024×768 or widescreen resolutions such as 1440×900 and 1680×1050. The last number, color depth should be 32 unless you are running very old programs and want 16 bit colors. First, for the lower resolution file enter:
C:\nircmd\nircmd.exe cmdshortcut “~$folder.desktop$” “800×600″ setdisplay 800 600 32
and save it in C:\NirCmd as 800×600 Resolution.bat
Moving on to the larger resolution, make a new file with:
C:\nircmd\nircmd.exe cmdshortcut “~$folder.desktop$” “1280×1024″ setdisplay 1280 1024 32
and save it in C:\NirCmd as 1280×1024 Resolution.bat
Now you can double-click each of these to make desktop shortcuts called 800×600 and 1280×1024, double-click on the desktop shortcuts to quickly resize the desktop. As in the Mute Unmute example, you can change the icons to whatever you feel like, here are two I picked out of the default set, I’ll have to remember to do a post on custom icons in the future.
![]()
Before moving into some more advanced command sets, I’ll explain how this can work with Launchy. Launchy should already scan the desktop for shortcuts and therefore find the examples that created desktop shortcuts. However, you may not want to have all commands as desktop shortcuts, or you may want to type up commands on the fly. To do either of these, the C:\NirCmd folder should be added to Launchy’s catalog. Bring up Launchy, Right-Click on it and select Options. Here click on the Catalog tab and hit the + (plus) button under Directories to add C:\Nircmd while it is selected type *.bat in the text-entry box under file types and hit the + button right underneath it. Do the same thing for *.exe, then make sure the box next to Executables is checked.
Now click Rescan Catalog and Launchy should add all of your .bat files in the folder as well as nircmd.exe. To try this, bring up Launchy and type:
MonitorOff
It should find the MonitorOff.bat before you finish typing, hit Enter to run it and it should 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 an NirCmd command directly from Launchy, in the Launchy box type:
nircmd
Next hit the Tab key and you should get nircmd -> in the launchy window. You can then type any Nircmd command after the ->
nircmd -> screensaver
will turn on the screensaver.
There are a lot of commands and examples to try out, especially since you can have multiple commands in a single .bat file. Next up is a quick set of commands to tidy up Windows and logoff (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 all of the recycling bins, clear the computer 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.
There are many more commands to cover, including ones that manipulate files, enter text, or even move and click the mouse. Please feel free to leave a comment requesting additional help or examples.





























{ 6 comments… read them below or add one }
Haven’t had a good look at this yet, but I think it would be more useful with AutoHotKey than Launchy.
Great tuto man!!
Thanks!
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
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.
Colin:
I’m not sure off-hand why the monitor script is not working, I would check which resolutions you can use in your monitor’s display settings (right-click on the desktop and select properties and select the settings tab). Then try to set it to one of those resolutions with the command C:\NirCmd\nircmd.exe setdisplay 1024 768 32 or whatever resolution you need.
Ian:
I didn’t see any commands to switch user in the NirCmd documentation, however it is an active project where they will add new commands with each new version, so I would contact the dev team about getting it added for the next version. http://www.nirsoft.net/contact-new.html
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).
Leave a Comment