NirCmd is a freeware utility that allows you to perform tasks from the command line, .bat files, desktop shortcuts and even是一個免費的實用工具,可以讓你執行任務的命令行。蝙蝠檔案,桌面捷徑,甚至 Launchy . 。 There’sa large list of commands on the NirCmd website.還有大名單的命令NirCmd網站。 I’ve picked out a few that I’ve found useful, but you may find another great use for NirCmd after reading through the examples.我已經挑選了幾個,我發現有用的,但你會發現另一個偉大的使用NirCmd讀通過的例子。 This was written and tested in WindowsXP but it should also work in other versions of Windows.這是書面和測試WindowsXP ,但它也應該在其他版本的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\下一步的內容解壓縮到一個文件夾中;我想說的東西簡單如 C : \ NirCmd \如果你使用別的替代,無論你看到ç : \ NirCmd \
Note: NirCmd may display as a virus, spyware, or potentially unwanted program on some anti-virus and anti-spyware programs (Sophos is one) this is because certain viruses and spyware include and use NirCmd to perform actions on the users PC.注: NirCmd可能會顯示為病毒,間諜軟件或潛在有害程序的一些反病毒和反間諜軟件程序( Sophos公司之一) ,這是因為某些病毒和間諜軟件包括和使用NirCmd執行行動對用戶的PC 。 However it is also used by many good programs as well, such as UBCD (which I may cover later), and by itself it poses no risk.但是,它也被許多好節目,如UBCD (我可能包括更新) ,以及它本身不構成危險。
The simplest way to use NirCmd is in the command line, however this article will concentrate on writing commands out in a file and using desktop shortcuts and Launchy to run them.最簡單的方法是使用NirCmd在命令行中,但是本文將集中於書面命令中的文件和使用的桌面快捷方式和Launchy來管理它們。 For a simple test, open up Notepad or your text-editor of choice and type in (or copy and paste):對於一個簡單的試驗,開拓記事本或您的文字編輯器的選擇和輸入(或複製並粘貼) :
C:\nircmd\nircmd.exe monitor off ç : \ nircmd \ nircmd.exe監測關閉
Save the file in your C:\NirCmd\ folder as MonitorOff.bat the exact name does not matter, but it should describe what it does.保存該文件在您的C : \ NirCmd \文件夾中MonitorOff.bat的確切名稱並不重要,但應說明它。
Now you should have MonitorOff.bat sitting in the C:\NirCmd\ folder, double-click on it to put your monitor into power save mode (you can move the mouse or hit a key to turn it back on).現在您應該已經坐在MonitorOff.bat在 C : \ NirCmd \文件夾,雙擊它把你監測到省電模式(您可以移動鼠標或觸及關鍵重新打開它) 。 You can then place a shortcut to MonitorOff.bat on your desktop, to do so Right-Click on MonitorOff.bat and select Send To and click Desktop (Create Shortcut) .然後,您就可以建立一個快捷方式MonitorOff.bat在您的桌面上,這樣做右擊MonitorOff.bat ,並選擇發送 ,然後按一下桌面(創建快捷方式) 。 Another method I like to use is to simply select MonitorOff.bat with a single-click then hold down Alt and drag the file onto the desktop.另一種方法我喜歡使用是簡單的選擇MonitorOff.bat與單一點擊然後按住Alt和拖動文件到桌面。
If you look carefully in the above screenshot, you’ll notice another .bat file titled wait2 screenshot.bat this one is a set of two commands to wait two seconds and then take a screenshot which is saved as shot.png in C:\Nircmd this comes in handy to capture a screenshot when you can’t just hit Ctrl + Print Screen which I what I normally use for screenshots.如果你仔細研究了上述畫面,您會發現另一個。 bat文件名為wait2 screenshot.bat這是一套兩個命令等待2秒鐘,然後採取截圖這是作為shot.png保存在 C : \ Nircmd這是在方便擷取畫面時,你不能只是Ctrl鍵+打印屏幕 ,我就是我通常使用的畫面。 Here is what the file contains:以下是該文件包含:
C:\nircmd\nircmd.exe cmdwait 2000 savescreenshot “C:\Nircmd\shot.png” ç : \ 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 ç : \ nircmd \ nircmd.exe cmdshortcut “ 〜 $ folder.desktop $ ” , “靜音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 .保存該文件在 C : \ NirCmd作為靜音Unmute.bat您也可以要求改變“靜音Unmute ”上面引號中的東西別人(的例子在網站上有“開關卷” ) ,這將更改名稱的桌面快捷,您也可以變更任何捷徑名稱後, 右鍵點擊它並選擇重命名。 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.現在雙擊靜音Unmute.bat創建一個新的捷徑在您的桌面上,應靜音的聲音第一次是雙擊,並取消靜音它的下一個。 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.如果預設的圖標,這是太乏味了你,右擊快捷靜音Unmute在您的桌面上,並選擇屬性,選擇快捷方式選項卡上,並點擊更改圖標按鈕。 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.這個問題最初使我NirCmd是有人想快速切換的決議,因為她需要一個較低的分辨率為老年人程序。 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.在這個範例中我將使用800 × 600 32位色的較低分辨率和1280 × 1024的32位元色彩的更高的分辨率,但可以替代的其他決議,如1024 × 768或寬的決議,如1440 × 900和1680 × 1050 。 The last number, color depth should be 32 unless you are running very old programs and want 16 bit colors.最後數量,顏色深度應該是32 ,除非您運行的是非常古老的程序,並希望16位顏色。 First, for the lower resolution file enter:第一,對於較低分辨率的檔案輸入:
C:\nircmd\nircmd.exe cmdshortcut “~$folder.desktop$” “800×600″ setdisplay 800 600 32 ç : \ nircmd \ nircmd.exe cmdshortcut “ 〜 $ folder.desktop $ ” “ 800 × 600 ” setdisplay 800 600 32
and save it in C:\NirCmd as 800×600 Resolution.bat並保存在 C : \ NirCmd為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 ç : \ nircmd \ nircmd.exe cmdshortcut “ 〜 $ folder.desktop $ ” , “ 1280 × 1024 ” setdisplay 1280 1024 32
and save it in C:\NirCmd as 1280×1024 Resolution.bat並保存在 C : \ NirCmd為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.現在您可以雙擊這些,使所謂的桌面快捷方式800 × 600和1280 × 1024 ,雙擊桌面上的快捷方式,迅速調整的桌面上。 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.如在靜音Unmute例如,你可以改變圖標,你感覺,這裡有兩個我挑選了默認的設置,我會記住這樣一個職位自定義圖標的未來。
![]()
Before moving into some more advanced command sets, I’ll explain how this can work with Launchy.前搬進一些更先進的指令集,我會解釋如何能與Launchy 。 Launchy should already scan the desktop for shortcuts and therefore find the examples that created desktop shortcuts. Launchy應該已經掃描桌面的捷徑,因此找到例子,創建桌面快捷方式。 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.做這兩種, 在 C : \ NirCmd文件夾中應補充Launchy的目錄。 Bring up Launchy, Right-Click on it and select Options .造就Launchy ,右擊它並選擇選項。 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.在這裡單擊目錄選項卡,並擊中+ (加號)按鈕下的目錄新增ç : \ Nircmd雖然它被選中輸入*.蝙蝠在文字輸入框中根據文件類型和擊中右+按鈕下面。 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 .現在點擊重新目錄和Launchy應增加您的所有。蝙蝠文件夾中的文件以及nircmd.exe 。 To try this, bring up Launchy and type:要嘗試這一點,帶出Launchy及類型:
MonitorOff
It should find the MonitorOff.bat before you finish typing, hit Enter to run it and it should turn off your monitor.它應該找到MonitorOff.bat您完成前打字,按Enter鍵運行它,並應關閉您的監視器。 All of the other .bat files created in C:\Nircmd should also be accessible by typing their filename in Launchy.所有其他。蝙蝠創建的文件在C : \ Nircmd也應該可以通過輸入其文件名在Launchy 。

You can also enter an NirCmd command directly from Launchy, in the Launchy box type:您也可以輸入一個命令NirCmd直接從Launchy ,在Launchy框中,鍵入:
nircmd
Next hit the Tab key and you should get nircmd -> in the launchy window.下一步打擊Tab鍵,你應該得到nircmd -> “在l aunchy窗口。 You can then type any Nircmd command after the ->然後,您可以輸入任何Nircmd命令後-> “
nircmd -> screensaver nircmd -> “屏幕保護程序
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.有很多命令和例子來嘗試,尤其是因為你可以有多個命令在一個單一。 bat文件。 Next up is a quick set of commands to tidy up Windows and logoff (good for a computer that has multiple users):下一步是一種快速的命令整理Windows和註銷(良好的計算機有多個用戶) :
C:\nircmd\nircmd.exe emptybin ç : \ nircmd \ nircmd.exe emptybin
C:\nircmd\nircmd.exe clipboard clear ç : \ nircmd \ nircmd.exe剪貼板明確
C:\nircmd\nircmd.exe exitwin logoff ç : \ nircmd \ nircmd.exe exitwin註銷
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.另存為Logoff.bat在 C : \ NirCmd \ 當你已經準備就緒,運行,將空所有的回收箱,明確了計算機和註銷當前用戶,一定要僅此一次測試要註銷的它將關閉所有的窗口,包括保存文件。
Note: Depending on your Launchy settings you may have to Rescan Catalog after making new .bat files or desktop shortcuts.注:根據您的Launchy設置您可能必須重新編錄後,作出新的。蝙蝠的文件或桌面的快捷方式。 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.如果您有它設置為0 ,這是手動只有升級 ,那麼你將不得不重新掃描目錄時,你想新的命令和快捷方式添加到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 ( 6評論...閱讀低於或 add one添加一個 } )
Haven’t had a good look at this yet, but I think it would be more useful with AutoHotKey than Launchy.沒有一個良好的看待這個問題,但我想這會更有益與AutoHotKey比Launchy 。
Great tuto man!!大tuto男子!
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嘿偉大甚至與我的作品推出所謂的關鍵應用發射,但我只能起飛和監控recycl空;電子郵件斌工作任何理由為什麼我不能獲得第一個工作,可以把更多的
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. Launchy本身將只允許您登出,以便希望NirCmd可以補充一點。
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.然後嘗試將其設置為其中的一個決議,命令ç : \ NirCmd \ nircmd.exe setdisplay 1024個768 32或任何你需要的決議。
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.我沒有看到任何命令切換用戶在NirCmd文件,但它是一個積極的項目,他們將增添新的命令每個新版本,所以我將聯繫有關開發團隊獲得它說的下一個版本。 http://www.nirsoft.net/contact-new.html
I just configured launchy to use the killprocess command, on a window I specify in launchy.我只是配置launchy使用killprocess命令,在一個窗口中指定launchy 。
I used the ‘runner’ plugin for this.我用了'亞軍'插件這一點。
I entered:我輸入:
“C:\WINDOWS\system32\nircmd.exe”的“ C : \窗口\ system32 \ nircmd.exe ”
and和
” killprocess $$.exe” “ 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.利用這一點,我差不多可以做任何事情, istead不得不寫一個新的批次檔,每變我需要改變。
(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). (噢,生物及毒素武器,為什麼我把nircmd在system32 ,是因為我可以運行nircmd命令容易從'經營' ,而不需要輸入的地方是儲存) 。
Leave a Comment發表您的評論