NirCmd的简介
NIrCMD是一个小命令行实用工具,允许您在不显示任何用户界面的情况下执行一些有用的任务。通过使用简单命令行选项运行NIMRCD,可以在注册表中写入和删除值和键,将值写入INI文件,拨号到Internet帐户或连接到VPN网络,重新启动Windows或关闭计算机,创建文件快捷方式,更改创建/修改日期。一个文件,改变你的显示设置,关闭你的显示器,打开你的CD-ROM驱动器的门,以及更多…
官网:http://www.nirsoft.net/utils/nircmd.html
NirCmd的安装
http://launcher.nirsoft.net/downloads/index.html
NirCmd的使用方法
使用NirCmd:
这款软件是一个独立的可执行程序,不需要任何的安装过程或者额外的dll文件支持。只需要把exe文件复制到任何指定的文件夹,并且根据你的需要添加你需要的命令选项运行即可。推荐复制NirCmd.exe到Windows目录,或者复制到任何系统中path环境变量中所列出的路径下,这样你就不需要在每次运行时输入NirCmd的完整路径。
从版本1.50开始,NirCmd的也可以在控制台中使用,在控制台版本中,所有的错误信息都会显示在控制台窗口中,而不是出现在信息框中
此实用工具可以在所有32位Windows操作系统:Windows 9x/ME,Windows NT ,Windows 2000, Windows XP,Windows Server 2003和Windows Vista。不过,一些NirCmd命令只能用在Windows NT/2000/XP/2003/Vista 。
例如:nircmd setdefaultsounddevice
---------------------
|
弹出盘符为J的光驱 |
NirCmd.exe cdrom open j: |
|
弹入盘符为Y的光驱 |
nircmd.exe cdrom close y: |
|
增加2000个单位的系统音量(最大65535) |
nircmd.exe changesysvolume 2000 |
|
降低5000个单位的系统音量(最大65535) |
nircmd.exe changesysvolume -5000 |
|
设置为最高音量 |
nircmd.exe setsysvolume 65535 |
|
设置为静音 |
nircmd.exe mutesysvolume 1 |
|
取消静音 |
nircmd.exe mutesysvolume 0 |
|
在静音与正常状态之间切换 |
nircmd.exe mutesysvolume 2 |
|
在桌面创建静音与正常状态切换命令的快捷方式 |
nircmd.exe cmdshortcut \"~$folder.desktop$\" \"Switch Volume\" mutesysvolume 2 |
|
关闭显示器 |
nircmd.exe monitor off |
|
启动默认屏保 |
nircmd.exe screensaver |
|
进入待机状态 |
nircmd.exe standby |
|
注销当前用户 |
nircmd.exe exitwin logoff |
|
弹出对话框,询问是否重启。选择是则重启电脑 |
nircmd.exe qboxcom \"Do you want to reboot?\" \"question\" exitwin reboot |
|
关闭computers.txt中指定的所有计算机 |
multiremote copy \"c:\\temp\\computers.txt\" exitwin poweroff force |
|
拨号连接到\"My Internet\" |
nircmd.exe rashangup \"My Internet\" |
|
设置IE窗口为75%透明度(192/256) |
nircmd.exe win trans i \"internet explorer\" 192 |
|
最小化所有的IE窗口 |
nircmd.exe win min class \"IE \" |
|
关闭所有的IE窗口 |
nircmd.exe win close class \"IE \" |
|
关闭所有的资源管理器窗口(我的电脑、文件夹等) |
nircmd.exe win close class \"CabinetWClass\" |
|
隐藏所有的IE窗口 |
nircmd.exe win hide class \"IE \" |
|
显示所有的IE窗口(在用上面命令隐藏后) |
nircmd.exe win show class \"IE \" |
|
把所有的顶级窗口居中 |
nircmd.exe win center alltop |
|
去掉我的电脑窗口的标题栏 |
nircmd.exe win -style \"my computer\" 0x00C0000 |
|
恢复我的电脑窗口的标题栏(当用上面命令去除后) |
nircmd.exe win +style \"my computer\" 0x00C0000 |
|
设置我的电脑窗口为从右至左的顺序(适用于希伯来语和阿拉伯语) |
nircmd.exe win +exstyle \"my computer\" 0x00400000 |
|
设置我的电脑窗口的所有子窗口为从右至左的顺序(适用同上) |
nircmd.exe win child \"my computer\" +exstyle all 0x00400000 |
|
在桌面创建可以关闭所有IE窗口的快捷方式 |
nircmd.exe cmdshortcut \" \"~$folder.desktop$ \"Close All IE\" win close class \"IE \" |
|
在桌面创建可以隐藏所有IE窗口的快捷方式 |
nircmd.exe cmdshortcut \" \"~$folder.desktop$ \"Hide All IE\" win hide class \"IE \" |
|
在桌面创建可以再次显示所有IE窗口的快捷方式 |
nircmd.exe cmdshortcut \" \"~$folder.desktop$ \"Show All IE\" win show class \"IE \" |
|
把calculator窗口设置为最上层窗口(在其他窗口之上) |
nircmd.exe win settopmost \"Calculator\" 1 |
|
恢复calculator窗口为原始窗口状态(不处于最上层) |
nircmd.exe win settopmost \"Calculator\" 0 |
|
创建calc.exe快捷方式到开始菜单->程序->Calculators |
nircmd.exe shortcut \"f:\\winnt\\system32\\calc.exe\" \"~$folder.programs$\\Calculators\" \"Windows Calculator\" |
|
隐藏桌面所有图标 |
nircmd.exe win hide class progman |
|
显示桌面所有图标(用以上命令隐藏过后) |
nircmd.exe win show class progman |
|
隐藏系统开始按钮 |
nircmd.exe win child class \"Shell_TrayWnd\" hide class \"button\" |
|
显示系统开始按钮 |
nircmd.exe win child class \"Shell_TrayWnd\" show class \"button\" |
|
隐藏系统时间 |
nircmd.exe win child class \"Shell_TrayWnd\" hide class \"TrayClockWClass\" |
|
显示系统时间 |
nircmd.exe win child class \"Shell_TrayWnd\" show class \"TrayClockWClass\" |
|
终止所有IE实例 |
nircmd.exe killprocess iexplore.exe |
|
创建桌面快捷方式,运行即可弹出光驱(K盘) |
nircmd.exe cmdshortcut \"~$folder.desktop$\" \"Open CDROM\" cdrom open k: |
|
将nirsoft网址创建到桌面快捷方式 |
nircmd.exe urlshortcut \"http://www.nirsoft.net\" \"~$folder.desktop$\" \"NirSoft\" |
|
添加nirsoft网址到收藏夹\\链接下 |
nircmd.exe urlshortcut \"http://www.nirsoft.net\" \"~$folder.favorites$\\ s\" \"NirSoft\" |
|
将nirsoft网址快捷方式创建到computers.txt中列出的所有计算机的桌面 |
nircmd.exe multiremote copy \"c:\\temp\\computers.txt\" urlshortcut \"http://www.nirsoft.net\" \"~$folder.common_desktop$\" \"NirSoft\" |
|
设置显示模式为800X600,24位色 |
nircmd.exe setdisplay 800 600 24 |
|
将设置显示模式为800X600,24位色命令创建为桌面快捷方式 |
nircmd.exe cmdshortcut \"~$folder.desktop$\" \"800x600x24\" setdisplay 800 600 24 |
|
复制所有桌面快捷方式到其他文件夹(f:\\temp\\desktop) |
nircmd.exe execmd copy \"~$folder.desktop$\\*.lnk\" f:\\temp\\desktop |
|
重启你的Apache server服务器(windows NT/2000/XP/2003) |
nircmd.exe service restart apache |
|
将重启Apache server服务器命令创建为桌面快捷方式 |
nircmd.exe cmdshortcut \"~$folder.desktop$\" \"Restart Apache\" service restart apache |
|
重启IIS(互联网信息服务) |
nircmd.exe service restart w3svc |
|
重启MySql |
nircmd.exe service restart MySql |
|
打开指定注册表项/值 |
nircmd.exe regedit \"HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\" \"CommonFilesDir\" |
|
打开你在注册表编辑器中复制到剪切板的注册表项 |
nircmd regedit \"~$clipboard$\" |
|
禁用屏保 |
nircmd.exe regsetval sz \"HKCU\\control panel\\desktop\" \"ScreenSaveActive\" 0 |
|
取消禁用屏保 |
nircmd.exe regsetval sz \"HKCU\\control panel\\desktop\" \"ScreenSaveActive\" 1 |
|
改变指定文件的日期/时间(创建时间和修改时间) |
nircmd.exe setfiletime \"c:\\temp\\myfile.txt\" \"24-06-2003 17:57:11\" \"22-11-2005 10:21:56\" |
|
复制桌面所在路径到剪切板 |
nircmd.exe clipboard set ~$folder.desktop$ |
|
复制开始菜单文件夹路径到剪切板 |
nircmd.exe clipboard set ~$folder.start_menu$ |
|
复制文本info1.txt中的内容到剪切板 |
nircmd.exe clipboard readfile \"c:\\My Files\\info1.txt\" |
|
将剪切板中内容添加到文本info1.txt中 |
nircmd.exe clipboard addfile \"c:\\My Files\\info1.txt\" |
|
清空剪切板 |
nircmd.exe clipboard clear |
|
创建所有在\"c:\\temp\\folders.txt\"中指定的文件夹,文件夹路径名用回车符隔开 |
nircmd.exe paramsfile \"c:\\temp\\folders.txt\" \"\" \"\" execmd md ~$fparam.1$ |
|
安装所有在全局程序集缓存(GAC)中指定的.NET程序集 |
nircmd.exe gac install \"C:\\temp\\MyAssembly\\bin\\MyAssembly.dll\" |
|
清空所有磁盘上的回收站 |
nircmd.exe emptybin |
|
对一个标准的Windows信息框回复确认 |
nircmd.exe dlg \"\" \"\" click yes |
|
延迟2秒钟,然后保存当前屏幕截图到shot.png |
nircmd.exe cmdwait 2000 savescreenshot \"f:\\temp\\shot.png\" |
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: |
| Speaks the text currently in the clipboard (For Windows XP/Vista/7/8). | speak text ~$clipboard$ |
| Speaks the text stored inside speak.txt into speak.wav filename (For Windows XP/Vista/7/8). | speak file \"c:\\temp\\speak.txt\" 0 100 \"c:\\temp\\speak.wav\" 48kHz16BitStereo |
| 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 i \"internet explorer\" 192 |
| Minimize all your Internet Explorer windows | nircmd.exe win min class \"IE \" |
| Close all your Internet Explorer windows | nircmd.exe win close class \"IE \" |
| 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 \"IE \" |
| Show all your Internet Explorer windows (after you made them hidden with previous example) | nircmd.exe win show class \"IE \" |
| Center all top-level windows | nircmd.exe win center alltop |
| Remove the bar of My Computer window. | nircmd.exe win -style \"my computer\" 0x00C00000 |
| Return the bar of My Computer window that we removed in the previous example. | nircmd.exe win +style \"my computer\" 0x00C00000 |
| Set the My Computer window to right-to-left order (For hebrew and arabic languages) | nircmd win +exstyle \"my computer\" 0x00400000 |
| Set all child windows of My Computer window to right-to-left order (For hebrew and arabic languages) | nircmd win child \"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 \"IE \" |
| Create a shortcut on your desktop that hides all your Internet Explorer windows | nircmd.exe cmdshortcut \" \"~$folder.desktop$ \"Hide All IE\" win hide class \"IE \" |
| 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 \"IE \" |
| Set the Windows Calculator as top-most window (above all other windows) | nircmd.exe win settopmost \"Calculator\" 1 |
| Set the Windows Calculator back to regular window (non top-most window) | nircmd.exe win settopmost \"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 s folder. | nircmd.exe urlshortcut \"http://www.nirsoft.net\" \"~$folder.favorites$\\ s\" \"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\" |
| Save 10 screenshots in a loop, and wait 60 seconds between the screenshot save calls. The filenames of the screenshot will contain the time and date of the saved screenshot. | nircmd.exe loop 10 60000 savescreenshot c:\\temp\\scr~$currdate.MM_dd_yyyy$-~$currtime.HH_mm_ss$.png |
| Wait until Firefox is closed, and then say \"Firefox was closed\" | nircmd.exe waitprocess firefox.exe speak text \"Firefox was closed\" |
| Run RegEdit with SYSTEM user (On Windows 7/8/Vista/2008), which allows you to view all hidden system Registry keys | nircmd.exe elevatecmd runassystem c:\\windows\\regedit.exe |
许可:
这是一款免费软件。只要不从此中收取费用,你就可以自由的通过软盘,CD,网络或者其他方法发布。注意在发布时应包含此发布包内的所有文件,不得有任何修改。
NirCmd的一般语法
nircmd.exe {showerror}[command][command parameters]
showerror是可选参数。如果指定了此参数,那么在命令运行过程中如果发生错误,错误信息会显示在屏幕上。否则,会忽略所有错误例:
nircmd.exe showerror rasdial \"dial1\"
nircmd.exe rasdial \"dial1\"
在上面的两个例子中,NirCmd会尝试连接diall入口,在第一个例子中,如果连接失败,将会显示一条有关此问题的错误信息;在第二个例子中,如果连接失败则不会显示错误信息。
特殊的字符串序列
从版本1.20开始,NirCmd允许在命令参数中插入特殊的字符。下表列出了可以使用的特殊字符串序列:
| 序列 | 描述 |
|---|---|
| ~n | 换行(包含换行符和回车符) |
| ~q | 双引号 \" |
| ~t | 制表符 Tab键 |
| ~xnn | 用一个包含两位十六进制数字的ASCII来代表任何字符。例如:~x41 (字符\'A\'), ~x27 (单引号) |
| ~$variable$ | 代表系统变量,更多信息请看下面。 |
| ~~ | 代表单个~字符 |
例:
NirCmd infobox \"This is the first line~n~qThis is a second line, in quotes~q\" \"Example\"
上面的例子会显示一个包含两行的信息框。
系统变量
从1.40版本开始,NirCmd提供了特殊字符代表文件夹以及其他系统变量。每个变量都以字符~开头,后面的变量名包含在两个$内。
例:~$folder.desktop$就代表了系统桌面这个文件夹的路径。(可以用nircmd infobox \"~$folder.desktop\"来查看)。
下表就指定了可以使用的一些变量:
| 变量名 | 描述 |
|---|---|
| clipboard | 代表复制到剪切板的文本内容 |
| param.paramname | 当指定一个param变量时,屏幕上会显示一个输入窗口,要求为指定的参数输入文本(可以理解为给参数赋值),所输入的 文本会被插入到命令行中。例:在下面的命令中,会要求输入2个参数(1和2),所输入的文本会显示在信息框中。nircmd infobox ~$param.1$ ~$param.2$ |
| fparam.number | 从指定的文本中加载指定的参数,更多信息请参考命令paramsfile |
| sys.varname | 可以使用此选项来表示系统上的任何环境变量。例: ~$sys.username$, ~$sys.windir$, ~$sys.computername$, ~$sys.logonserver$, ~$sys.temp$, 等等 |
| nir.exefile | 当前运行的NirCmd的完整路径(如: c:winntnircmd.exe) |
| loopcount | 执行循环命令时指定循环次数 |
| currtime.TimeFormat | 根据“TimeFormat”选择的时间格式指定当前时间。 如:~%currtime.HH_mm_ss%,如需对时间格式了解更多参考currtime(时间格式字符串) |
| currdate.DateFormat | 根据“DateFormat”选择的日期格式指定当前日期。 如:~%currdate.MM_dd_yyyy% ,如需对日期格式了解更多参考currdate(日期格式字符串) |
| folder.nircmd | NirCmd所在的文件夹(路径) |
| folder.desktop | 用户桌面(路径) |
| folder.start_menu | 用户开始菜单文件夹(路径) |
| folder.programs | 用户开始菜单程序文件夹(路径) |
| folder.startup | 用户开始菜单程序启动文件夹(路径) |
| folder.recent | 用户开始菜单程序启动文件夹(路径) |
| folder.favorites | 用户收藏夹(路径) |
| folder.cookies | cookies文件夹(路径) |
| folder.appdata | Application Data文件夹(路径) |
| folder.common_desktop | All user桌面文件夹(路径) |
| folder.common_start_menu | ALL user开始菜单文件夹(路径) |
| folder.common_programs | ALL user开始菜单程序文件夹(路径) |
| folder.common_startup | ALL user开始菜单程序启动文件夹(路径) |
| folder.common_favorites | ALL user收藏夹(路径) |
| folder.windows | Windows文件夹(路径) |
| folder.system | 系统文件夹(路径) |
例:
1、 创建开始菜单程序文件夹的快捷方式:
NirCmd shortcut \"c:winntsystem32calc.exe\" \"~$folder.programs$My Programs\" \"Calculator\"
2、 删除用户桌面的某个快捷方式:
NirCmd execmd del \"~$folder.desktop$calc.lnk\"
3、 显示当前已登录的用户:
NirCmd infobox \"The current logged-on user is ~$sys.username$\" \"logged-on user\"
4、 截图并用包含当前时间和日期的文件名进行保存
NirCmd savescreenshot c:tempscr~%currdate.MMddyyyy%-~%currtime.HHmmss%.png
currtime时间格式字符串
时间格式字符串中可能包含以下内容:(这些格式字符串需要区分大小写!)
| h | 单数字小时;十二小时制 |
| hh | 双数字小时;十二小时制 |
| H | 单数字小时;二十四小时制 |
| HH | 双数字小时;二十四小时制 |
| m | 单数字分钟 |
| mm | 双数字分钟 |
| s | 单数字秒 |
| ss | 双数字秒 |
| t | 标记字符串的单个时间字符, 如A 或者P. |
| tt | 标记字符串的多时间字符, 如AM或者PM. |
currdate日期格式字符串
日期格式字符串中可能包含以下内容:(这些格式字符串需要区分大小写!)
| d | 月份中的单数字日期 |
| dd | 月份中的双数字日期 |
| ddd | 星期中的三位数日期缩写 |
| dddd | 星期中的日期全称 |
| M | 单数字月份 |
| MM | 双数字月份 |
| MMM | 三位数缩写月份 |
| MMMM | 月份全称 |
| y | 年份末尾数 |
| yy | 年份末尾两位数 |
| yyyy | 年份全称 |
在远程计算机上执行NirCmd命令
从1.40版本开始,可以在远程计算机上执行NirCmd命令。但是,应该注意以下的一些限制和问题:
1、此选项只可用于Windows NT,Windows 2000和Windows XP。不可以在Windows 9X下使用。
2、必须以管理员身份登陆远程计算机。
3、远程计算机上的任务计划(Task Schedule)服务必须开启。(默认所有的NT/2000/XP计算机都自动开启此服务,所以不用担心这点。)
4、由于任务计划服务的一些限制,必须等待60秒命令才可以在远程计算机上执行。
5、远程计算机上的命令是在system账户下执行,因此某些同样的命令在本地执行可能会有所区别。
这是两条在用于远程计算机上执行的NirCmd命令:
remote 用于在一台远程计算机上执行命令
multiremote 用于在多台远程计算机上执行命令
帮助
如果不记得确切的语法命令,随时可以查看帮助文件 NirCmd (NirCmd.chm) 或者可以使用帮助命令(help command)中提到的 http://nircmd.nirsoft.net/,例如: nircmd.exe help multiremote
NirCmd命令
| remote {copy} [//computer] [NirCmd command] 在远程计算机上执行NirCmd命令。如果指定了{copy}参数,NirCmd将会复制自身到远程计算机的 Windows目录下。如果远程计算机的Windows目录下不存在NirCmd.exe,则必须指定{copy}参数。例: remote copy comp1 exitwin poweroff remote comp2 infobox \"This is a message from NirCmd\" \"Hello !\" remote comp3 lockws |
| multiremote {copy} [computers file] [NirCmd command] 在多台远程计算机上执行 NirCmd命令。如果指定了{copy}参数,NirCmd将会复制自身到远程计算机的 Windows目录下。如果远程计算机的Windows目录下不存在NirCmd.exe,则必须指定{copy}参数。参数[computers file]指定一个文件,此文件包含了以回车符分隔的计算机列表。 文件[computers file] 举例: //comp1 //comp2 //winxp1 //winxp2 //nirsoft 在参数[NirCmd command]中指定的命令会在所有[computers file]指定的计算机上运行。 例: 关闭所有在computers.txt中列出的计算机 multiremote \"c:tempcomputers.txt\" exitwin poweroff force 锁定所有在computers.txt中列出的计算机 multiremote \"c:tempcomputers.txt\" lockws 复制NirCmd.exe到所有computers.txt中列出的计算机上,并且关闭其显示器。 multiremote copy \"c:tempcomputers.txt\" monitor off 复制NirCmd.exe到所有computers.txt中列出的计算机上,运行wul.exe (WinUpdatesList),以便保存所有计算机上的Windows更新信息。 multiremote copy \"c:tempcomputers.txt\" exec hide c:tempwul.exe /shtml \"c:tempwul_~$sys.computername$.html\" |
| cmdwait [Number of Milliseconds] [NirCmd Command] 等待指定的毫秒数,然后执行指定的NirCmd命令。 例: cmdwait 1000 monitor off |
| loop [Number of Times] [Number of Milliseconds] [NirCmd Command] 指定命令执行循环次数, 命令执行期间,NirCmd 等待第二个参数指定的毫秒数, 通过~%loopcount% 变量指定循环中的呼叫号码(从1 到 n). 例: loop 3 2000 speak text \"Call Number ~%loopcount%\" loop 10 60000 savescreenshot c:tempscr~%loopcount%.png |
| paramsfile [Parameters File] [Delimiters] [Quote Character] [NirCmd Command] 这是一个很强大的命令,它允许从一个文本文件中加载一个或多个参数,从而可以成倍的执行NirCmd命令。此文本文件内容可以以逗号、Tab、分号或者 任何在参数[Delimiters]中指定的符号作为分隔符。 举一个例子:假设有如下文本文件,包含了一些用户名和密码,以\',\'隔开: user01, 123456 user02, abcfg user03, 5fr23 user04, 33333 下面的NirCmd命令将会创建在以上文本文件中指定的4个用户名和密码。(通过使用Windows 2000/XP操作系统提供的net user命令) nircmd.exe paramsfile \"c:tempusers.txt\" \",\" \"\" execmd net user ~$fparam.1$? ~$fparam.2$ /add ~$fparam.1$指每行的第一个词条,即用户名。 ~$fparam.2$指每行的第二个词条,即密码。 例: paramsfile \"c:tempfolders.txt\" \"\" \"\" execmd md ~$fparam.1$ paramsfile \"c:tempshortcuts.txt\" \",\" \"~q\" shortcut ~$fparam.1$ \"~$folder.desktop$\" ~$fparam.2$ |
| infobox [message text] [ ] 在屏幕上显示一个简单的信息框。 例: infobox \"This is a message box !\" \"message\" |
| qbox [message text] [ ] [program to run] 在屏幕上显示一个询问对话框。如果用户回答是,则运行程序。 例: qbox \"Do you want to run the calculator ?\" \"question\" \"calc.exe\" |
| qboxtop [message text] [ ] [program to run] 同qbox命令类似,但显示的对话框为最上层窗口。 |
| qboxcom [message text] [ ] [NirCmd Command] 在屏幕上显示一个询问对话框。如果用户回答是,则执行参数[NirCmd Command]中指定的NirCmd命令 例: qboxcom \"Do you want to lock your workstation ?\" \"question\" lockws qboxcom \"Do you want to turn off the monitor ?\" \"monitor\" monitor off |
| qboxcomtop [message text] [ ] [NirCmd Command] 同qboxcom命令类似,但现实的对话框为最上层窗口。 |
| [ File] 此命令允许运行包含在一个脚本文件中的一系列命令,此脚本文件由参数[ File]指定。 例: \"c:/temp/msg.ncl\" 脚本文件样例: infobox \"Hello !\" \"This is the first message\" infobox \"Hello !\" \"This is the second message\" infobox \"Hello !\" \"This is the third message\" |
| regedit [key] [value name] 打开注册表编辑器的指定项/值。 例: regedit \"HKLM/Software/Microsoft/Windows/CurrentVersion\" \"CommonFilesDir\" regedit \"HKEY_CURRENT_USER/Control Panel/Desktop\" \"Wallpaper\" |
| regsetval [type] [key] [value name] [value] 把值写入注册表。参数[type]可以为:\"sz\"或\"expand_sz\" 指字符串;\"dword\" 指32位数字;\"binary\" 指二进制数据。如果在参数[key]中指定的项在注册表中不存在,则会自动创建此项。 例: regsetval dword \"HKEY_CURRENT_USER/Software/Test\" \"Value1\" \"0xaabbccdd\" regsetval dword \"HKCU/Software/Test\" \"Value2\" \"10561\" regsetval sz \"HKCU/Software/Test\" \"Value3\" \"string value\" regsetval binary \"HKLM/Software/Test\" \"Value4\" \"6a cb ab dd 80 86 95 |
| regdelval [key] [value] 删除注册表中的某个值 例: regdelval \"HKEY_CURRENT_USER/Software/Test\" \"Value1\" |
| regdelkey [key] 删除注册表中的整项。如果指定的项有一个或多个子项时,此命令失效。 例: regdelkey \"HKEY_CURRENT_USER/Software/Test\" |
| inisetval [INI filename] [section] [key] [value] 把值写入ini文件。如果文件不存在,则自动创建。 例: inisetval \"c:/windows/test.ini\" \"section1\" \"TestValue\" \"1\" |
| inidelval [INI filename] [section] [key] 删除ini文件中的一对项-值。 例: inidelval \"c:/windows/test.ini\" \"section1\" \"TestValue\" |
| inidelval [INI filename] [section] 删除ini文件的整段(以[]分段),且删除此段中包含的所有值。 例: inidelsec \"c:/windows/test.ini\" \"section1\" |
| regsvr [reg or unreg] [filename or wildcard] {log file} 注册或解除注册DLL/OCX文件。 在第一个参数[reg or unreg]中,指定\"reg\"表示注册文件,指定\"unreg\"表示解除注册文件。 在第二个参数[filename or wildcard]中,可以指定要注册或解除注册的某个单一文件,多个文件用通配符指定。 第三个为可选参数,指定一个日志文件来保存注册操作的结果。 例: regsvr reg \"f:/winnt/system32/fv*.ocx\" \"c:/temp/log1.txt\" regsvr unreg \"f:/winnt/system32/ab*.dll\" |
| rasdial [Entry Name] {Phonebook File} {User Name} {Password} {Domain} 不显示任何用户界面,建立拨号连接到RAS服务接口(VPN网络或电话线)。除了参数[Entry Name]为必需,其他参数都为可选参数。如果没有指定可选参数,或者指定为空字符串(\"\"),将会使用默认值。 例: rasdial \"My Internet\" rasdial \"VPN1\" \"\" \"user1\" \"abc1234\" \"domain1\" |
| inetdial [Entry Name] 建立拨号连接到RAS服务接口(VPN网络或电话线),显示拨号进程的信息对话框。 此命令只适用于IE版本4.0及其以上。注意:此命令在旧版本的Windows 98上可能无效。 例: inetdial \"VPN1\" |
| rasdialdlg [Entry Name] {Phonebook File} {Phone Number or IP Address} 显示用于拨号连接的RAS服务接口。参数{Phonebook File}和{Phone Number}为可选参数。如果没有指定参数{Phonebook File}或者指定为空字符串(\"\"),则使用默认电话簿。 此命令只适用于Windows NT,Windows 2000和Windows XP。不支持Windows 98/ME。 例: rasdialdlg \"Internet1\" \"\" \"9876543\" rasdialdlg \"VPN1\" |
| rashangup {Entry Name} 中断RAS连接。可以用此命令来中止之前用命令inetdial或者rasdial创建的连接。如果没有指定参数{Entry Name},所有活动连接都将被终止。 例: rashangup \"VPN1\" rashangup |
| setdialuplogon [Entry Name] [User Name] {Password} {Domain} {Phonebook File} 修改拨号连接的用户名、密码、域名。 参数: [Entry Name]: 拨号连接名 [User Name]: 设定拨号连接的用户名 {Password}: 设定拨号连接的密码 {Domain}: 设定拨号连接的域名 {Phonebook File}: 电话簿文件包含了要修改的拨号连接条目。如果没有指定此参数,将会使用默认电话簿。 例: setdialuplogon \"VPN1\" \"user1\" \"asder443\" \"domain1\" setdialuplogon \"Internet1\" \"nirs3\" \"q5r4df7yh5 |
| exitwin [shutdown type] {additional option} 此命令用来关闭当前会话窗口。 参数[shutdown type]可以是一下值之一: logoff: 结束所有进程,注销当前用户,显示登录对话框来切换用户 reboot: 关闭系统,重新启动 poweroff: 关闭系统,关闭电源(只对支持此性质的系统有效)。 shutdown: 只关闭系统,不重启,不关电源 还可以使用一下的附加选项: force: 立即强制终止所有应用程序。使用此选项可能会是正在运行的程序丢失数据。建议只在特殊情况下使用! forceifhung: 终止无响应的应用程序。适用于Windows 2000/XP 例: exitwin reboot exitwin poweroff force exitwin logoff forceifhung |
| initshutdown {message} {timeout value in seconds} {force} {reboot} 系统关机。此命令与exitwin命令有些相似,但它具备一些exitwin不支持的操作。此命令不支持Windows 95/98/ME。如果没有指定任何参数,将会在不显示任何信息的情况下立即关闭计算机。 参数: {message}: 指定关机前要显示的信息。 {timeout value in seconds}:指定关机前等待的秒数。 {force}: 不保存当前数据,强制终止所有应用程序。 {reboot}: 关机后重启。 例: initshutdown \"shutting down the system within 60 seconds\" 60 reboot initshutdown \"\" 0 force |
| abortshutdown 取消用initshutdown命令进行的关机操作,不接受任何参数。 例: abortshutdown |
| lockws 锁定计算机。锁定计算机后,必须输入密码来解锁。只适用于Windows 2000/XP。 |
| monitor [action] 改变显示器状态。参数[action]可以包含下列值: off: 关闭显示器 on:打开显示器 low: 设置为低耗电状态 此命令只适用于支持此性质的系统。 例: monitor off monitor on |
| screensaver 开启默认屏保 |
| standby {force} 关闭计算机,并处于待机模式。如果指定{force}参数,系统会不经过所有应用程序许可直接进入待机状态,不推荐使用此参数。适用于支持待机模式的系统 例: standby force standby |
| hibernate {force} 关闭计算机,并处于休眠模式。如果指定{force}参数,系统会不经过所有应用程序许可直接进入休眠状态,不推荐使用此参数。适用于支持休眠模式的系统 例: hibernate force hibernate |
| shortcut [filename] [folder] [shortcut ] {arguments} {icon file} {icon resource number} {ShowCmd} {Start In Folder} {Hot Key} 创建文件的快捷方式: 参数: [filename]: 指定要创建快捷方式的文件 [folder]: 指定快捷方式的创建位置。可以指定任何有效的文件夹,包括一些代表系统文件夹的特殊变量,如:~$folder.programs$ (开始/程序文件夹)等等 [shortcut ]: 此快捷方式的名字 {arguments}:可选参数 - 执行此文件的附加参数。 {icon file}:可选参数 - 如果想使用其他图标来代替默认图标则使用此参数。 {icon resource number}: 可选参数 - 图标文件中的图标号码 {ShowCmd}:可选参数 - 最大化或最小化程序运行窗口。指定\"max\"最大化窗口,\"min\"最小化窗口。 {Start In Folder}: 可选参数 - 指定开始位置。如果没有制定此参数,起始位置就自动设置为在参数[filename]中指定的文件夹。 {Hot Key}:可选参数 - 指定快捷键(热键)。例: Alt+Ctrl+A, Alt+Shift+F8, Alt+Ctrl+Shift+Y 例: shortcut \"f:/winnt/system32/calc.exe\" \"~$folder.desktop$\" \"Windows Calculator\" shortcut \"f:/winnt/system32/calc.exe\" \"~$folder.programs$/Calculators\" \"Windows Calculator\" shortcut \"f:/Program Files/KaZaA/Kazaa.exe\" \"c:/temp/MyShortcuts\" \"Kazaa\" shortcut \"f:/Program Files\" \"c:/temp/MyShortcuts\" \"Program Files Folder\" \"\" \"f:/winnt/system32/shell32.dll\" 45 shortcut \"f:/Program Files\" \"c:/temp/MyShortcuts\" \"Program Files Folder\" \"\" \"\" \"\" \"max\" |
| cmdshortcut [folder] [shortcut ] [command] 创建一个NirCmd命令快捷方式。运行快捷方式时(双击),命令中指定的[command]参数将被执行。 例: cmdshortcut \"~$folder.desktop$\" \"Open CDROM\" cdrom open k: cmdshortcut \"c:temp\" \"Turn Monitor Off\" monito |
| cmdshortcutkey [folder] [shortcut ] [hot key] [command] 创建一个指定快捷键的NirCmd命令快捷方式。当运行此快捷方式(双击),参数[command]指定的命令会被执行。 例: cmdshortcut \"~$folder.desktop$\" \"Open CDROM\" cdrom open k: cmdshortcut \"c:/temp\" \"Turn Monitor Off\" monitor off |
| urlshortcut [URL] [Folder] [Shortcut ] 创建网页快捷方式(类似收藏夹中的网页快捷方式)。参数[Folder]指定此快捷方式的创建位置,如果想创建快捷方式到收藏夹,则使用:~$ folder.favorites$ variable. 例: urlshortcut \"http://www.nirsoft.net\" \"~$folder.favorites$\" \"NirSoft Web Site\" urlshortcut \"http://www.google.com\" \"~$folder.favorites$/Search Engines\" \"Google\" urlshortcut \"http://www.yahoo.com\" \"c:/temp\" \"Yahoo\" |
| exec [show/hide] [application + command-line] 运行应用程序,可为此程序指定一个或多个命令行参数。参数[show/hide]指定显示运行还是隐藏运行。如果指定 \'hide\',则将在后台运行此程序。 例: exec show \"f:/winnt/system32/calc.exe\" exec hide \"c:/temp/wul.exe\" /savelangfile |
| exec2 [show/hide] [working folder] [application + command-line] 类似exec命令,但还支持其它参数,[working folder]指定运行程序的默认目录。 例: exec2 show \"f:/winnt/system32\" \"f:/winnt/system32/calc.exe\" exec2 hide c:/temp \"c:/temp/wul.exe\" /savelangfile |
| execmd [command] 执行命令提示符下(控制台)命令,屏幕上不显示任何信息。 例: execmd del \"~$folder.desktop$/calc.lnk\" execmd mkdir f:/temp/desktop1 execmd copy \"~$folder.desktop$/*.lnk\" f:/temp/desktop |
| shexec [operation] [filename] 根据注册表中文件扩展名的定义打开或打印文件。如:扩展名为.doc的文件将会以MS-Word方式打开,.html文件以默认浏览器打开。如果指定一个 有效的网址,将会在默认浏览器中打开此网页。参数[operation]可以为\"open\"或\"print\"。 例: shexec \"open\" \"c:/my documents/abc.doc\" shexec \"print\" \"d:/files/1.pdf\" shexec \"open\" \"http://www.nirsoft.net\" |
| setfiletime [filename or wildcard] [Created Date] {Modified Date} {Accessed Date} 修改一个或多个文件的创建/修改/访问日期。第一个参数可以为单一的文件名或者用通配符指定。日期参数必须以下面的格式指定:\"dd-mm-yyyy hh:nn:ss\" 。如果没有指定日期参数或者指定为空串(\"\")则日期不变。如果指定时间参数为now,则修改为当前日期和时间。 例: setfiletime \"c:/temp/*.exe\" \"15-05-2004 11:22:12\" \"22-01-2005 21:22:55\" setfiletime \"c:/temp/myfile.txt\" \"24-06-2003 17:57:11\" \"\" \"22-11-2005 10:21:56\" setfiletime \"c:/temp/myfile.txt\" now now |
| setfilefoldertime [filename, folder or wildcard] [Created Date] {Modified Date} {Accessed Date} 修改一个或多个文件的创建/修改/访问日期。此命令同setfiletime命令非常相似。唯一的不同在于 setfilefoldertime命令还可以修改文件夹的日期 - 只适用于Windows 2000/XP。 例: setfilefoldertime \"c:/temp/myfolder\" \"10-01-2003 11:22:12\" \"12-11-2002 02:34:11\" setfilefoldertime \"c:/temp/myfolder\" now now |
| emptybin {drive} 清空回收站。参数{drive}指定想要清空的回收站所在的磁盘。如果没有指定此参数,则清空所有磁盘的回收站。 例: emptybin f: emptybin |
| setdisplay [width] [height] [color bits] {refresh rate} {-updatereg} {-allusers} 修改显示设置。参数[width]和[height]代表的屏幕上的像素点数。参数[color bits]表示屏幕的颜色位数(8 - 256 color, 16 - 16bit color, 24 - 24bit color等等)。{refresh rate}是可选参数,指定显示器的刷新频率。如果指定了{-updatereg}参数,新设置会保存在注册表中。如果同时指定{-updatereg} 和{-allusers}参数,新设置会应用与计算机上所有用户,并且保存在注册表中。 例: setdisplay 800 600 24 -updatereg setdisplay 1024 768 24 90 setdisplay 1024 768 8 |
| killprocess [process] 结束指定进程。在参数[process]中,可以指定进程名的完整路径(如:C:/Program Files/Internet Explorer/iexplore.exe)或者只指定进程名(如: iexplore.exe)。还可以通过后缀\'/\'指定进程的ID(如: /1120)。 例: killprocess iexplore.exe killprocess \"c:/winnt/system32/calc.exe\" killprocess /1830 |
| closeprocess [process] 通过关闭顶级窗口来结束指定进程。与killprocess命令相反,closeprocess并不强制立即结束进程。相反,它给指定进程的顶级窗口发送 一个WM_CLOSE消息。注意:此命令对没有用户界面的进程无效。 在参数[process]中,可以指定进程名的完整路径(如:C:/Program Files/Internet Explorer/iexplore.exe)或者只是进程名(如:iexplorer.exe)。还可以通过后缀\'/\'指定进程的ID(如: /1120)。 例: closeprocess iexplore.exe closeprocess \"c:/winnt/system32/calc.exe\" closeprocess /1830 |
| waitprocess [process] {Command} 等待直到指定进程结束 在参数[process]中,可以指定进程名的完整路径(如:C:/Program Files/Internet Explorer/iexplore.exe)或者只是进程名(如:iexplorer.exe)。还可以通过后缀\'/\'指定进程的ID(如: /1120)。 例: waitprocess iexplore.exe waitprocess \"c:/winnt/system32/calc.exe\" waitprocess /1830 |
| setprocesspriority [process] [priority] 为指定进程设置新的优先级 在参数[priority]中,可以指定以下值:normal, low, belownormal, abovenormal, high, realtime。 在参数[process]中,可以指定进程名的完整路径(如:C:/Program Files/Internet Explorer/iexplore.exe)或者只是进程名(如:iexplorer.exe)。还可以通过后缀\'/\'指定进程的ID(如: /1120)。 例: setprocesspriority iexplore.exe high setprocesspriority \"c:/winnt/system32/calc.exe\" low setprocesspriority /1830 abovenormal |
| setprocessaffinity [process] [list of processor numbers] 设置进程关联, 在参数[process]中,指定进程使用的处理器(仅具有多个处理器的计算机),可以指定完整路径名的进程 (如: \'C:Program Files/Internet Explorer/iexplore.exe\') 或者只是进程名(如: iexplore.exe). )。还可以通过后缀\'/\'指定进程的ID(如: /1120)。在参数[list of processor numbers] 中,可以指定需要的处理器数字,0是第一个处理器,1是第二个,依此类推。 例: setprocessaffinity iexplore.exe 0 1 setprocessaffinity \"c:winntsystem32calc.exe\" 0 1 2 3 setprocessaffinity /1830 0 |
| memdump [process] [dump file] [bytes per line] {bytes to read} {start address} {nohex} {noascii} 根据指定的参数,读取进程的内存,并写入文件。 参数: [process]: 想要读取其内存的进程。可以指定完整路径,或仅进程名,或用后缀\'/\'指定进程ID。 [dump file]: 用来保存指定进程内存的内容的文件名。 [bytes per line]: dump file中每行的内存字节数。 {bytes to read}: 读取的字节数 {start address}: 指定进程的开始读取地址 {nohex}:可选参数。如果指定此参数,内存数据不会以十六进制形式保存。 {noascii}:可选参数。如果指定此参数,内存数据不会以ASCII格式保存。 例: memdump iexplore.exe \"c:/temp/dump.txt\" \"16\" \"0x10000\" \"0x400000\" memdump calc.exe \"c:/temp/calc.txt\" \"32\" \"0x30000\" \"0x400000\" nohex memdump /525 \"c:/temp/dump.txt\" \"16\" \"0x100000\" \"0x120000\" noascii |
| service {Computer} [action] [service name] 改变驱动和服务的状态和启动类型 参数: {//Computer}:可选参数。指定远程计算机名。如果忽略此参数,默认使用本地计算机。 [action]: 要进行的操作。此参数包含以下值: start:开启指定的服务或驱动程序。 stop: 停止指定的服务或驱动程序。 pause: 暂停指定的服务或驱动程序。 continue: 继续指定的服务或驱动程序。 restart: 停止并开启指定的服务或驱动程序。 auto:修改指定的服务或驱动程序为自动。 manual:修改指定的服务或驱动程序为手动。 disabled:禁用指定的服务或驱动程序 boot: (只适用于驱动程序)修改指定的驱动程序为引导(boot)。 system:(只适用于驱动程序)修改指定的驱动程序为系统(system)。 [service name]: 服务或驱动程序名 例: service start schedule service //remote stop schedule service restart w3svc |
| win [action] [find] [window to find] [Additional Parameters] 针对子窗口 win child [find] [top window to find] [action] [find] [child window to find] [Additional Parameters] 通过此命令,可以关闭、隐藏、显示、最大化和最小化指定的窗口。 参数 [action]:对指定的窗口要进行的操作: child: 对指定顶级窗口的子窗口进行操作。 close:关闭指定窗口。 hide: 隐藏指定窗口。 show: 显示指定窗口(在用hide命令隐藏后)。 hideshow:隐藏指定窗口然后再显示此窗口。可用此命令重新填写窗口内容。 activate: 把指定窗口放到上层。 max: 最大化指定窗口。 min: 最小化指定窗口。 normal:最大、最小化指定窗口后,恢复其到正常状态。 trans:使指定窗口透明。参数[Additional Parameters]指定透明程度,值位于0 - 255之间。0 = 完全透明。255 = 完全不透明。 setsize: 设定指定窗口的大小。参数[Additional Parameters]指定窗口的大小,值包括x,y,width,height。 move: 移动/调整窗口。参数[Additional Parameters]指定要移动/调整的像素点数,值包括:x,y,width,height。 center: 指定窗口居中。 settopmost:设置指定窗口的最上层显示状态。如果参数[Additional Parameters]为1,指定窗口为最上层显示,如果为0,则取消最上层显示。 redraw:刷新指定窗口。 settext:修改指定窗口标题/名称。 focus: 在指定窗口上设置焦点。 disable:禁用指定窗口。 enable: 启用指定窗口。 +style: 对指定窗口增加样式常量。参数[Additional Parameters] 指定了增加的样式常量。 -style:移除指定窗口的样式常量。参数[Additional Parameters]指定要移除的样式常量。 +exstyle: 对指定窗口增加扩展样式常量。参数[Additional Parameters]指定要增加的扩展样式常量。 -exstyle:移除指定窗口的扩展样式常量。参数[Additional Parameters]指定要移除的扩展样式常量。 postmsg: 传递信息到指定窗口。参数[Additional Parameters]中的三个值指定了信息参数:Msg, wParam, lParam。 sendmsg: 发送信息到指定窗口。参数[Additional Parameters]中的三个值指定了信息参数:Msg, wParam, lParam。 dlgclick:发送一个鼠标单击命令到对话框内的按钮。参数[Additional Parameters] 指定了按钮的控件ID,或者下列预定义的按钮之一: yes, no, ok, cancel, retry, ignore, close, help。 dlgsettext: 设置文本到对话框内部指定控件。参数[Additional Parameters] 指定了控件ID。 dlgsetfocus: 设置焦点到对话框内部指定控件。参数[Additional Parameters] 指定了按钮的控件ID。 [find]:指定了找到窗口的方式: handle: 通过在参数[window to find]中指定窗口句柄来查找指定窗口。 id: 通过指定子窗口的ID查找需要的子窗口。适用于子窗口。 class: 通过在参数[window to find]中指定窗口类名来查找指定窗口。 : 通过在参数[window to find]中指定精确的窗口名来查找指定窗口。 s :通过在参数[window to find]中指定窗口的前几个字符来查找指定窗口。 i : 通过指定一系列存在于窗口标题中的字符来查找指定窗口。 alltop: 所有顶层 继续阅读与本文标签相同的文章上一篇 :
云南首个5G智慧高速应用创新实验室在昆明揭牌下一篇 :
5G正式商用,你想知道的都在这儿
您的足迹:
|
