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

[其他] [有奖翻译]T001:命令行工具NirCmd.exe2.20(综合性工具)

【活动说明】http://bbs.bathome.net/thread-2991-1-1.html

【官方下载】http://www.nirsoft.net/utils/nircmd.html

【本地下载】http://bbs.bathome.net/thread-1881-1-1.html

【任务内容】

Description

NirCmd is a small command-line utility that allows you to do some useful tasks without displaying any user interface. By running NirCmd with simple command-line option, you can write and delete values and keys in the Registry, write values into INI file, dial to your internet account or connect to a VPN network, restart windows or shut down the computer, create shortcut to a file, change the created/modified date of a file, change your display settings, turn off your monitor, open the door of your CD-ROM drive, and more...

Examples of what you can do with NirCmd

Open the door of J: CD-ROM drivenircmd.exe cdrom open j:
Close the door of Y: CD-ROM drivenircmd.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 valuenircmd.exe setsysvolume 65535
Mute the system volumenircmd.exe mutesysvolume 1
Unmute the system volumenircmd.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 monitornircmd.exe monitor off
Start the default screen savernircmd.exe screensaver
Put your computer in 'standby' modenircmd.exe standby
log off the current usernircmd.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 computernircmd.exe exitwin poweroff
Turn off all computers specified in computers.txt !multiremote copy "c:\temp\computers.txt" exitwin poweroff force
Dial to "My Internet" connectionnircmd.exe rasdial "My Internet"
Disconnect the "My Internet" connectionnircmd.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 windowsnircmd.exe win min class "IEFrame"
Close all your Internet Explorer windowsnircmd.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 windowsnircmd.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 windowsnircmd.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 windowsnircmd.exe cmdshortcut " "~$folder.desktop$ "Close All IE" win close class "IEFrame"
Create a shortcut on your desktop that hides all your Internet Explorer windowsnircmd.exe cmdshortcut " "~$folder.desktop$ "Hide All IE" win hide class "IEFrame"
Create a shortcut on your desktop that shows back all your Internet Explorer windowsnircmd.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->Calculatorsnircmd.exe shortcut "f:\winnt\system32\calc.exe" "~$folder.programs$\Calculators" "Windows Calculator"
Hide the desktop windownircmd.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 traynircmd.exe win child class "Shell_TrayWnd" hide class "button"
Show the start button on the system traynircmd.exe win child class "Shell_TrayWnd" show class "button"
Hide the clock on the system traynircmd.exe win child class "Shell_TrayWnd" hide class "TrayClockWClass"
Show the clock on the system traynircmd.exe win child class "Shell_TrayWnd" show class "TrayClockWClass"
Kill (terminate) all instance of Internet Explorer processesnircmd.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 desktopnircmd.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.txtnircmd.exe multiremote copy "c:\temp\computers.txt" urlshortcut "http://www.nirsoft.net" "~$folder.common_desktop$" "NirSoft"
Set the display mode to 800x600x24bit colorsnircmd.exe setdisplay 800 600 24
Create a shortcut on the desktop that set the display mode to 800x600x24bit colorsnircmd.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 servernircmd.exe cmdshortcut "~$folder.desktop$" "Restart Apache" service restart apache
Restart your IISnircmd.exe service restart w3svc
Restart MySqlnircmd.exe service restart MySql
Open the desired Registry key/value in RegEditnircmd.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 savernircmd.exe regsetval sz "HKCU\control panel\desktop" "ScreenSaveActive" 0
Enable the screen savernircmd.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 clipboardnircmd.exe clipboard set ~$folder.desktop$
Copy your start menu folder path to the clipboardnircmd.exe clipboard set ~$folder.start_menu$
Copy the content of info1.txt (simple text file) to the clipboardnircmd.exe clipboard readfile "c:\My Files\info1.txt"
Add the text content of clipboard to info1.txtnircmd.exe clipboard addfile "c:\My Files\info1.txt"
Clear the clipboardnircmd.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.pngnircmd.exe cmdwait 2000 savescreenshot "f:\temp\shot.png"


【获奖名单】

sylovanas +10

lhjoanna +50

由于单帖评分的上限而未能领完奖励积分的,可继续跟帖接受奖励。

【补充说明】

RiceFans 也参加了本次翻译活动,但其提供的下载链接已经失效,无法验证其翻译的内容,因此不予积分奖励,非常遗憾。

友情提示:如需上传附件到本论坛,强烈建议先进行压缩。

【活动结束】

2009-02-25

【应用实例】

批处理实现定时屏幕截图 http://bbs.bathome.net/thread-4131-1-2.html

批处理实现批量创建快捷方式 http://bbs.bathome.net/viewthread.php?tid=4019

批处理清除剪贴板內容 http://bbs.bathome.net/viewthread.php?tid=3942

批处理将剪贴板中的内容保存为文件 http://bbs.bathome.net/viewthread.php?tid=2875

批处理中nircmd设置新分辨率实现重启后依然有效 http://bbs.bathome.net/viewthread.php?tid=3937
我帮忙写的代码不需要付钱。如果一定要给,请在微信群或QQ群发给大家吧。
【微信公众号、微信群、QQ群】http://bbs.bathome.net/thread-3473-1-1.html
【支持批处理之家,加入VIP会员!】http://bbs.bathome.net/thread-67716-1-1.html

nircmd

nircmd自带变数
~n:换行 ( 包含换行和回车 LF - CR)
ex:
  1. nircmd infobox "我愛~n批處理" ""
  2. 我愛
  3. 批處理
复制代码
~q:显示双引号 "
~t:显示tab字元
~xnn: 显示ascii字元 (16进位) ex: ~x25 = %
~~: 显示字元 ~
~$variable$: 显示传回的变数,如下:

~$clipboard$:显示剪贴簿内的资料 ( 纯文字 )
~$param.paramname$:让你自己输入显示的文字 ex:
  1. nircmd infobox ~$param.1$ ~$param.2$
复制代码
~$fparam.number$: 不清楚,应该是显示自己汇入的文字文件
~$sys.varname$:显示系统已定义的变数 ex
nircmd infobox "windows文件为位置在~$sys.windir$ " "文件位置"

~$nir.exefile$:显示nircmd所在文件目录
~$folder.startup$:表示为使用者启动文件夹
ex:
  1. nircmd infobox "使用者\菜单\‘启动’位置为~$folder.startup[code]nircmd infobox "使用者\菜单\‘启动’位置为~$folder.startup$ " "
复制代码
时间不够了先这些

[ 本帖最后由 sylovanas 于 2009-1-6 18:14 编辑 ]
1

评分人数

TOP

NirCmd v2.20帮助文档中文译本

         很好的活动啊,怎么顶贴的人不多啊。按照地址下载了NirCmd,很强大的工具。我看了英文版的帮助文档,batcher列出的只是开始的例子,还是希望大家看看下面具体的每个命令。刚开始并没打算翻译的,本是想偷个懒看看有没有人翻译出来,我直接看的。一是英文不怎么好,二来马上就考试了。不过等了几天好像还是没有,我就抽空儿花了几个晚上把帮助文档大概翻译了遍(包括下面的详细命令)。大家看之前先说明几点:
    1、E文比较好的还是直接看原版,NirCmd我第一次用,有些命令我也体会的不是很深,所以可能会产生偏差。
    2、有些命令涉及到的一些操作我还未学(包括一些术语)
,所以也未经测试,只是按照字面意思翻译出来了。
    3、欢迎大家都来看,一起来找出其中的错误,争取经过大家的努力,能够变成一份比较完美的中文译本。

    4、附件中包含了NirCmd.exe、NirCmdc.exe、英文版帮助文档、我翻译的中文版帮助文档。

链接: https://pan.baidu.com/s/1Ffab3WRE10Rmc6b61SS09g 提取码: p84b
2

评分人数

TOP

终于翻译完了

链接: https://pan.baidu.com/s/19ulVBDQPqvbhInz_pTYw_A 提取码: q33e
有翻译不好的地方,请大家指教
1

评分人数

TOP

顶一下

这东西太好了,找好久了

TOP

我下载下来了!正在看!

TOP

好文章,找了好久,谢谢。

TOP

很好啊 用在BAT里正合适

TOP

貌似来晚了一步...

TOP

非常强大的好东西,正需要,谢谢楼主

TOP

本人常用的命令
http://hi.baidu.com/hongsedaima/blog/item/883583da287b2ad1b7fd48c8.html

TOP

回复 3楼 的帖子

請問nircmdnircmdc 有什麼不同?

TOP

当不带任何参数时,
nircmd 会有个对话框显示程序相关信息,并且有个 CopyToWindowsDirectory 按钮可以直接将其复制到系统目录下;
nircmdc 是纯的命令行。

TOP

怎么不翻译win里的find或它的使用方法?

TOP

回复 14楼 的帖子

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

TOP

返回列表