[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[其他] A small command-line utility: NirCmd 2.35

【最新版本】2.35(2009-04-20)
【本地下载】http://bcn.bathome.net/s/tool/index.html?key=NirCmd
【官网下载】http://www.nirsoft.net/utils/nircmd.zip

Examples of what you can do with NirCmd
Open the door of J: CD-ROM drive => nircmd.exe cdrom open j:
Close the door of Y: CD-ROM drive => nircmd.exe cdrom close y:
Increase the system volume by 2000 units (out of 65535) => nircmd.exe changesysvolume 2000
Decrease the system volume by 5000 units (out of 65535) => nircmd.exe changesysvolume -5000
Set the volume to the highest value => nircmd.exe setsysvolume 65535
Mute the system volume => nircmd.exe mutesysvolume 1
Unmute the system volume => nircmd.exe mutesysvolume 0
Switch the system volume between the mute and normal state. => nircmd.exe mutesysvolume 2
Create a shortcut on your desktop that switch the system volume between the mute and normal state. => nircmd.exe cmdshortcut "~$folder.desktop$" "Switch Volume" mutesysvolume 2
Turn off the monitor => nircmd.exe monitor off
Start the default screen saver => nircmd.exe screensaver
Put your computer in 'standby' mode => nircmd.exe standby
log off the current user => nircmd.exe exitwin logoff
Ask if you want to reboot, and if you answer 'Yes', reboot the computer. => nircmd.exe qboxcom "Do you want to reboot ?" "question" exitwin reboot
Turn off your computer => nircmd.exe exitwin poweroff
Turn off all computers specified in computers.txt ! => multiremote copy "c:\temp\computers.txt" exitwin poweroff force
Dial to "My Internet" connection => nircmd.exe rasdial "My Internet"
Disconnect the "My Internet" connection => nircmd.exe rashangup "My Internet"
Make your Internet Explorer windows 75% transparent ! (192 / 256) => nircmd.exe win trans ititle "internet explorer" 192
Minimize all your Internet Explorer windows => nircmd.exe win min class "IEFrame"
Close all your Internet Explorer windows => nircmd.exe win close class "IEFrame"
Close all your Explorer windows (My Computer, folders, and so on) => nircmd.exe win close class "CabinetWClass"
Hide all your Internet Explorer windows => nircmd.exe win hide class "IEFrame"
Show all your Internet Explorer windows (after you made them hidden with previous example) => nircmd.exe win show class "IEFrame"
Center all top-level windows => nircmd.exe win center alltop
Remove the title bar of My Computer window. => nircmd.exe win -style title "my computer" 0x00C00000
Return the title bar of My Computer window that we removed in the previous example. => nircmd.exe win +style title "my computer" 0x00C00000
Set the My Computer window to right-to-left order (For hebrew and arabic languages) => nircmd win +exstyle title "my computer" 0x00400000
Set all child windows of My Computer window to right-to-left order (For hebrew and arabic languages) => nircmd win child title "my computer" +exstyle all 0x00400000
Create a shortcut on your desktop that closes all your Internet Explorer windows => nircmd.exe cmdshortcut " "~$folder.desktop$ "Close All IE" win close class "IEFrame"
Create a shortcut on your desktop that hides all your Internet Explorer windows => nircmd.exe cmdshortcut " "~$folder.desktop$ "Hide All IE" win hide class "IEFrame"
Create a shortcut on your desktop that shows back all your Internet Explorer windows => nircmd.exe cmdshortcut " "~$folder.desktop$ "Show All IE" win show class "IEFrame"
Set the Windows Calculator as top-most window (above all other windows) => nircmd.exe win settopmost title "Calculator" 1
Set the Windows Calculator back to regular window (non top-most window) => nircmd.exe win settopmost title "Calculator" 0
Create a shortcut to Windows calculator under Start Menu->Programs->Calculators => nircmd.exe shortcut "f:\winnt\system32\calc.exe" "~$folder.programs$\Calculators" "Windows Calculator"
Hide the desktop window => nircmd.exe win hide class progman
Show the desktop window (After hiding it in previous example) => nircmd.exe win show class progman
Hide the start button on the system tray => nircmd.exe win child class "Shell_TrayWnd" hide class "button"
Show the start button on the system tray => nircmd.exe win child class "Shell_TrayWnd" show class "button"
Hide the clock on the system tray => nircmd.exe win child class "Shell_TrayWnd" hide class "TrayClockWClass"
Show the clock on the system tray => nircmd.exe win child class "Shell_TrayWnd" show class "TrayClockWClass"
Kill (terminate) all instance of Internet Explorer processes => nircmd.exe killprocess iexplore.exe
Create a shortcut on your desktop that opens the door of K: CDROM drive when you run it. => nircmd.exe cmdshortcut "~$folder.desktop$" "Open CDROM" cdrom open k:
Create a shortcut to NirSoft Web site on your desktop => nircmd.exe urlshortcut "http://www.nirsoft.net" "~$folder.desktop$" "NirSoft"
Add NirSoft Web site to your Favorities under Links folder. => nircmd.exe urlshortcut "http://www.nirsoft.net" "~$folder.favorites$\Links" "NirSoft"
Create a shortcut to NirSoft Web site on the desktop of all computers listed in computers.txt => nircmd.exe multiremote copy "c:\temp\computers.txt" urlshortcut "http://www.nirsoft.net" "~$folder.common_desktop$" "NirSoft"
Set the display mode to 800x600x24bit colors => nircmd.exe setdisplay 800 600 24
Create a shortcut on the desktop that set the display mode to 800x600x24bit colors => nircmd.exe cmdshortcut "~$folder.desktop$" "800x600x24" setdisplay 800 600 24
Copy all shortcuts on your desktop to another folder (f:\temp\desktop). => nircmd.exe execmd copy "~$folder.desktop$\*.lnk" f:\temp\desktop
Restart your Apache server (under Windows NT/2000/XP/2003) => nircmd.exe service restart apache
Create a shortcut on your desktop that restarts the Apache server => nircmd.exe cmdshortcut "~$folder.desktop$" "Restart Apache" service restart apache
Restart your IIS => nircmd.exe service restart w3svc
Restart MySql => nircmd.exe service restart MySql
Open the desired Registry key/value in RegEdit => nircmd.exe regedit "HKLM\Software\Microsoft\Windows\CurrentVersion" "CommonFilesDir"
Open the Registry key that you copied to the clipboard in RegEdit. => nircmd regedit "~$clipboard$"
Disable the screen saver => nircmd.exe regsetval sz "HKCU\control panel\desktop" "ScreenSaveActive" 0
Enable the screen saver => nircmd.exe regsetval sz "HKCU\control panel\desktop" "ScreenSaveActive" 1
Change the date/time of the specified filename (creation time and modified time) => nircmd.exe setfiletime "c:\temp\myfile.txt" "24-06-2003 17:57:11" "22-11-2005 10:21:56"
Copy your desktop folder path to the clipboard => nircmd.exe clipboard set ~$folder.desktop$
Copy your start menu folder path to the clipboard => nircmd.exe clipboard set ~$folder.start_menu$
Copy the content of info1.txt (simple text file) to the clipboard => nircmd.exe clipboard readfile "c:\My Files\info1.txt"
Add the text content of clipboard to info1.txt => nircmd.exe clipboard addfile "c:\My Files\info1.txt"
Clear the clipboard => nircmd.exe clipboard clear
Create all folders specified in "c:\temp\folders.txt". The folder path names are separated by CRLF characters. => nircmd.exe paramsfile "c:\temp\folders.txt" "" "" execmd md ~$fparam.1$
Install the specified .NET assembly in the global assembly cache (like gacutil) => nircmd.exe gac install "C:\temp\MyAssembly\bin\MyAssembly.dll"
Empty the recycle bin in all drives. => nircmd.exe emptybin
Answer 'Yes' to a standard Windows message-box. => nircmd.exe dlg "" "" click yes
Wait 2 seconds, and then save the current screen to shot.png => nircmd.exe cmdwait 2000 savescreenshot "f:\temp\shot.png"

官方网站:http://www.nirsoft.net/utils/nircmd.html
1

评分人数

    • pusofalse: 感谢分享,正需要这个。PB + 10
我帮忙写的代码不需要付钱。如果一定要给,请在微信群或QQ群发给大家吧。
【微信公众号、微信群、QQ群】http://bbs.bathome.net/thread-3473-1-1.html
【支持批处理之家,加入VIP会员!】http://bbs.bathome.net/thread-67716-1-1.html

nircmd沒人介紹

功能非常多很好用的命令列工具

用来恶作剧或者是部分批处理会方便很多

比如说:

nircmd cmdwait 5000 nircmd.exe cdrom open
这样光盘的托盘等五秒就自动打开

nircmd infobox "这是提示窗口" "我爱批处理"
这样会跳出窗口提示

nircmd killprocess notepad.exe
杀notepad.exe进程,可指定路径
如: nircmd killprocess c:\windows\system32\notepad.exe

隐藏运行批处理
如: nircmd execmd c:\123.bat

隐藏运行记事簿 ( 要关notepad进程可以用 nircmd killprocess notepad.exe )
nircmd exec hide notepad.exe

功用太多,使用功能就找官方页面

[url=http://www.nirsoft.net/utils/nircmd.html]http://www.nirsoft.net/utils/nircmd.html[/url]

[ 本帖最后由 sylovanas 于 2008-11-19 15:59 编辑 ]

TOP

我帮忙写的代码不需要付钱。如果一定要给,请在微信群或QQ群发给大家吧。
【微信公众号、微信群、QQ群】http://bbs.bathome.net/thread-3473-1-1.html
【支持批处理之家,加入VIP会员!】http://bbs.bathome.net/thread-67716-1-1.html

TOP

阿,浪费空间了,我删除。

=====================
我是指我又上传了一次附件(在原来二楼,已删),浪费空间

[ 本帖最后由 wxcute 于 2008-11-19 17:24 编辑 ]

TOP

啊没看到是我疏忽

就麻烦删除了感谢~

TOP

合并一下吧,呵呵。
我帮忙写的代码不需要付钱。如果一定要给,请在微信群或QQ群发给大家吧。
【微信公众号、微信群、QQ群】http://bbs.bathome.net/thread-3473-1-1.html
【支持批处理之家,加入VIP会员!】http://bbs.bathome.net/thread-67716-1-1.html

TOP

更新到了 2.20 :)



[ 本帖最后由 Batcher 于 2009-5-1 22:01 编辑 ]

TOP

nircmd 确实好用。由于E文不好,未能解读所有功能。如果有E文好的朋友,帮忙把它的帮助文档翻译一下,造福大家。

[ 本帖最后由 newxso 于 2009-1-7 19:53 编辑 ]

TOP

我帮忙写的代码不需要付钱。如果一定要给,请在微信群或QQ群发给大家吧。
【微信公众号、微信群、QQ群】http://bbs.bathome.net/thread-3473-1-1.html
【支持批处理之家,加入VIP会员!】http://bbs.bathome.net/thread-67716-1-1.html

TOP

压缩包中除了主程序 nircmd.exe 外,还有的 nircmdc.exe 有何用呢?是否用于控制台中使用。

TOP

nircmdc是将运行后的结果输出至主控台

C:\>nircmd execmd echo.123>1.txt
C:\>type 1.txt

C:\>nircmdc execmd echo.123>1.txt
C:\>type 1.txt
123

C:\>

TOP

支持大神的分享,仔细研究一下

TOP

返回列表