『第 6 楼』:
使用 LLM 解释/回答一下
RUNDLL.exe 命令详解(转贴)
常用Windows9x的朋友一定对Rundll32.exe和Rundll.exe这两个档案不
会陌生吧,不过,由於这两个程式的功能原先只限於在微软内部使用,因而真正
知道如何使用它们的朋友想必不多。那麽好,如果你还不清楚的话,那麽
就让我来告诉你吧。
首先,请你做个小实验(请事先保存好你正在执行的程式的结果,否则...)∶
点击“开始-程式-Ms-Dos方式”,进入Dos视窗,然後键入
"rundll32.exe user.exe,restartwindows",再按下回车键,这时你将看到,机
器被重启了!怎麽样,是不是很有趣?
当然,Rundll的功能绝不仅仅是重启你的机器。其实,Rundll者,顾名思义,
执行Dll也,它的功能就是以命令列的方式呼叫Windows的动态链结库,
Rundll32.exe与Rundll.exe的区别就在於前者是呼叫32位的链结库,而後者是运
用於16位的链结库,它们的命令格式是∶
RUNDLL.EXE ,,
这里要注意三点∶1.Dll档案名中不能含有空格,比如该档案位於
c:\Program Files\目录,你要把这个路径改成c:\Progra~1\;2.Dll档案名与Dll
入口点间的逗号不能少,否则程式将出错并且不会给出任何资讯!3.这是最重要的
一点∶Rundll不能用来呼叫含返回值参数的Dll,例如Win32API中的GetUserName(),
GetTextFace()等。在Visual Basic中,提供了一条执行外部程式的指令Shell,格
式为∶
Shell “命令列”
如果能配合Rundll32.exe用好Shell指令,会使您的VB程式拥有用其他方法难
以甚至无法实现的效果∶仍以重启为例,传统的方法需要你在VB工程中先建立一
个模组,然後写入WinAPI的声明,最後才能在程式中呼叫。而现在只需一句:
Shell “rundll32.exe user.exe,restartwindows”就搞定了!是不是方便
多了?
实际上,Rundll32.exe在呼叫各种Windows控制面板和系统选项方面有著独特
的优势。下面,我就将本人在因特网上收集的有关Rundll的指令列举如下(很有
用的,能省去你很多呼叫Windows API的时间!!),供大家在程式设计中引用∶
命令列: rundll32.exe shell32.dll,Control_RunDLL
功能: 显示控制面板
命令列: rundll32.exe shell32.dll,Control_RunDLL access.cpl,,1
功能: 显示“控制面板-辅助选项-键盘”选项视窗
命令列: rundll32.exe shell32.dll,Control_RunDLL access.cpl,,2
功能: 显示“控制面板-辅助选项-声音”选项视窗
命令列: rundll32.exe shell32.dll,Control_RunDLL access.cpl,,3
功能: 显示“控制面板-辅助选项-显示”选项视窗
命令列: rundll32.exe shell32.dll,Control_RunDLL access.cpl,,4
功能: 显示“控制面板-辅助选项-滑鼠”选项视窗
命令列: rundll32.exe shell32.dll,Control_RunDLL access.cpl,,5
功能: 显示“控制面板-辅助选项-传统”选项视窗
命令列: rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl @1
功能: 执行“控制面板-添加新硬体”向导。
命令列: rundll32.exe shell32.dll,SHHelpShortcuts_RunDLL AddPrinter
功能: 执行“控制面板-添加新印表机”向导。
命令列: rundll32.exe shell32.dll,Control_RunDLL appwiz.cpl,,1
功能: 显示 “控制面板-添加/删除程式-安装/卸载” 面板。
命令列: rundll32.exe shell32.dll,Control_RunDLL appwiz.cpl,,2
功能: 显示 “控制面板-添加/删除程式-安装Windows” 面板。
命令列: rundll32.exe shell32.dll,Control_RunDLL appwiz.cpl,,3
功能: 显示 “控制面板-添加/删除程式-启动盘” 面板。
命令列: rundll32.exe syncui.dll,Briefcase_Create
功能: 在桌面上建立一个新的“我的公文包”。
命令列: rundll32.exe diskcopy.dll,DiskCopyRunDll
功能: 显示复制软碟视窗
命令列: rundll32.exe apwiz.cpl,NewLinkHere %1
功能: 显示“建立快捷方式”的对话框,所建立的快捷方式的位置由%1参数决定。
命令列: rundll32.exe shell32.dll,Control_RunDLL timedate.cpl,,0
功能: 显示“日期与时间”选项视窗。
命令列: rundll32.exe shell32.dll,Control_RunDLL timedate.cpl,,1
功能: 显示“时区”选项视窗。
命令列: rundll32.exe rnaui.dll,RnaDial [某个拨号连接的名称]
功能: 显示某个拨号连接的拨号视窗。如果已经拨号连接,则显示目前的连接状态的视窗。
命令列: rundll32.exe rnaui.dll,RnaWizard
功能: 显示“新建拨号连接”向导的视窗。
命令列: rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,0
功能: 显示“显示属性-背景”选项视窗。
命令列: rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,1
功能: 显示“显示属性-萤屏保护”选项视窗。
命令列: rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,2
功能: 显示“显示属性-外观”选项视窗。
命令列: rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,3
功能: 显示显示“显示属性-属性”选项视窗。
命令列: rundll32.exe shell32.dll,SHHelpShortcuts_RunDLL FontsFolder
功能: 显示Windows的“字体”档案夹。
命令列: rundll32.exe shell32.dll,Control_RunDLL main.cpl @3
功能: 同样是显示Windows的“字体”档案夹。
命令列: rundll32.exe shell32.dll,SHformatDrive
功能: 显示格式化软碟对话框。
命令列: rundll32.exe shell32.dll,Control_RunDLL joy.cpl,,0
功能: 显示“控制面板-游戏控制器-一般”选项视窗。
命令列: rundll32.exe shell32.dll,Control_RunDLL joy.cpl,,1
功能: 显示“控制面板-游戏控制器-进阶”选项视窗。
命令列: rundll32.exe mshtml.dll,PrintHTML (HTML文档)
功能: 列印HTML文档。
命令列: rundll32.exe shell32.dll,Control_RunDLL mlcfg32.cpl
功能: 显示Microsoft Exchange一般选项视窗。
命令列: rundll32.exe shell32.dll,Control_RunDLL main.cpl @0
功能: 显示“控制面板-滑鼠” 选项 。
命令列: rundll32.exe shell32.dll,Control_RunDLL main.cpl @1
功能: 显示 “控制面板-键盘属性-速度”选项视窗。
命令列: rundll32.exe shell32.dll,Control_RunDLL main.cpl @1,,1
功能: 显示 “控制面板-键盘属性-语言”选项视窗。
命令列: rundll32.exe shell32.dll,Control_RunDLL main.cpl @2
功能: 显示Windows“印表机”档案夹。
命令列: rundll32.exe shell32.dll,Control_RunDLL main.cpl @3
功能: 显示Windows“字体”档案夹。
命令列: rundll32.exe shell32.dll,Control_RunDLL main.cpl @4
功能: 显示“控制面板-输入法属性-输入法”选项视窗。
命令列: rundll32.exe shell32.dll,Control_RunDLL modem.cpl,,add
功能: 执行“添加新调制解调器”向导。
命令列: rundll32.exe shell32.dll,Control_RunDLL mmsys.cpl,,0
功能: 显示“控制面板-多媒体属性-音频”属性页。
命令列: rundll32.exe shell32.dll,Control_RunDLL mmsys.cpl,,1
功能: 显示“控制面板-多媒体属性-视频”属性页。
命令列: rundll32.exe shell32.dll,Control_RunDLL mmsys.cpl,,2
功能: 显示“控制面板-多媒体属性-MIDI”属性页。
命令列: rundll32.exe shell32.dll,Control_RunDLL mmsys.cpl,,3
功能: 显示“控制面板-多媒体属性-CD音乐”属性页。
命令列: rundll32.exe shell32.dll,Control_RunDLL mmsys.cpl,,4
功能: 显示“控制面板-多媒体属性-设备”属性页。
命令列: rundll32.exe shell32.dll,Control_RunDLL mmsys.cpl @1
功能: 显示“控制面板-声音”选项视窗。
命令列: rundll32.exe shell32.dll,Control_RunDLL netcpl.cpl
功能: 显示“控制面板-网路”选项视窗。
命令列: rundll32.exe shell32.dll,Control_RunDLL odbccp32.cpl
功能: 显示ODBC32资料管理选项视窗。
命令列: rundll32.exe shell32.dll,OpenAs_RunDLL{drive:\path\filename}
功能: 显示指定档案(drive:\path\filename)的“打开方式”对话框。
命令列: rundll32.exe shell32.dll,Control_RunDLL password.cpl
功能: 显示“控制面板-密码”选项视窗。
命令列: rundll32.exe shell32.dll,Control_RunDLL powercfg.cpl
功能: 显示“控制面板-电源管理属性”选项视窗。
命令列: rundll32.exe shell32.dll,SHHelpShortcuts_RunDLL
PrintersFolder
功能: 显示Windows“印表机”档案夹。(同rundll32.exe shell32.dll,Control_RunDLL
main.cpl @2)
命令列: rundll32.exe shell32.dll,Control_RunDLL intl.cpl,,0
功能: 显示“控制面板-区域设置属性-区域设置”选项视窗。
命令列: rundll32.exe shell32.dll,Control_RunDLL intl.cpl,,1
功能: 显示“控制面板-区域设置属性-数字”选项视窗。
命令列: rundll32.exe shell32.dll,Control_RunDLL intl.cpl,,2
功能: 显示“控制面板-区域设置属性-货币”选项视窗。
命令列: rundll32.exe shell32.dll,Control_RunDLL intl.cpl,,3
功能: 显示“控制面板-区域设置属性-时间”选项视窗。
命令列: rundll32.exe shell32.dll,Control_RunDLL intl.cpl,,4
功能: 显示“控制面板-区域设置属性-日期”选项视窗。
命令列: rundll32.exe desk.cpl,InstallScreenSaver [萤屏保护档案名]
功能: 将指定的萤屏保护档案设置为Windows的屏保,并显示萤屏保护属性视窗。
命令列: rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,0
功能: 显示“控制面板-系统属性-传统”属性视窗。
命令列: rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,1
功能: 显示“控制面板-系统属性-设备管理器”属性视窗。
命令列: rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,2
功能: 显示“控制面板-系统属性-硬体配置档案”属性视窗。
命令列: rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,3
功能: 显示“控制面板-系统属性-性能”属性视窗。
命令列: rundll32.exe user.exe,restartwindows
功能: 强行关闭所有程式并重启机器。
命令列: rundll32.exe user.exe,exitwindows
功能: 强行关闭所有程式并关机。
命令列: rundll32.exe shell32.dll,Control_RunDLL telephon.cpl
功能: 显示“拨号属性”选项视窗
命令列: rundll32.exe shell32.dll,Control_RunDLL themes.cpl
功能: 显示“桌面主旨”选项面板
当然,不止是VisualBasic,象Delphi.VisualC++等其他程式设计语言也可以通
过呼叫外部命令的方法来使用Rundll的这些功能,具体方法这里就不再详细叙述
了。灵活的使用Rundll,一定会使你的程式设计轻轻松松,达到事半功倍的效果! 以上内容取自《程式设计技术》
Detailed Explanation of RUNDLL.exe Command (Repost)
Friends who often use Windows 9x must be familiar with the two files Rundll32.exe and Rundll.exe. However, since the functions of these two programs were originally only for internal use within Microsoft, there must be very few friends who really know how to use them. Well, if you are not clear about it, then let me tell you.
First of all, please do a small experiment (please save the results of the program you are running in advance, otherwise...): Click "Start - Programs - Ms-Dos Mode" to enter the Dos window, then type "rundll32.exe user.exe,restartwindows", and then press the Enter key. At this time, you will see that the computer is restarted! How about it, is it interesting?
Of course, the function of Rundll is not just to restart your computer. In fact, Rundll, as the name suggests, executes Dll. Its function is to call the Windows dynamic link library in the command line. The difference between Rundll32.exe and Rundll.exe is that the former calls 32-bit link libraries, and the latter is used for 16-bit link libraries. Their command format is:
RUNDLL.EXE <DLL name>,<entry point>
Three points should be noted here: 1. There should be no spaces in the Dll file name. For example, if the file is located in the c:\Program Files\ directory, you need to change this path to c:\Progra~1\; 2. The comma between the Dll file name and the Dll entry point cannot be omitted, otherwise the program will be wrong and no information will be given! 3. This is the most important point: Rundll cannot be used to call Dlls containing return value parameters, such as GetUserName(), GetTextFace() in Win32API. In Visual Basic, there is an instruction Shell for executing external programs, and the format is:
Shell "command line"
If you can use the Shell instruction well with Rundll32.exe, it will make your VB program have effects that are difficult or even impossible to achieve with other methods: still taking restart as an example, the traditional method requires you to first create a module in the VB project, then write the declaration of WinAPI, and finally call it in the program. But now it's done with just one sentence: Shell "rundll32.exe user.exe,restartwindows"! Isn't it much more convenient?
In fact, Rundll32.exe has unique advantages in calling various Windows control panels and system options. Next, I will list the relevant Rundll commands I collected on the Internet as follows (very useful, it can save you a lot of time in calling Windows API!!), for everyone to refer to in programming:
Command line: rundll32.exe shell32.dll,Control_RunDLL
Function: Display the control panel
Command line: rundll32.exe shell32.dll,Control_RunDLL access.cpl,,1
Function: Display the "Control Panel - Accessibility Options - Keyboard" option window
Command line: rundll32.exe shell32.dll,Control_RunDLL access.cpl,,2
Function: Display the "Control Panel - Accessibility Options - Sound" option window
Command line: rundll32.exe shell32.dll,Control_RunDLL access.cpl,,3
Function: Display the "Control Panel - Accessibility Options - Display" option window
Command line: rundll32.exe shell32.dll,Control_RunDLL access.cpl,,4
Function: Display the "Control Panel - Accessibility Options - Mouse" option window
Command line: rundll32.exe shell32.dll,Control_RunDLL access.cpl,,5
Function: Display the "Control Panel - Accessibility Options - Legacy" option window
Command line: rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl @1
Function: Execute the "Control Panel - Add New Hardware" wizard.
Command line: rundll32.exe shell32.dll,SHHelpShortcuts_RunDLL AddPrinter
Function: Execute the "Control Panel - Add New Printer" wizard.
Command line: rundll32.exe shell32.dll,Control_RunDLL appwiz.cpl,,1
Function: Display the "Control Panel - Add/Remove Programs - Install/Uninstall" panel.
Command line: rundll32.exe shell32.dll,Control_RunDLL appwiz.cpl,,2
Function: Display the "Control Panel - Add/Remove Programs - Install Windows" panel.
Command line: rundll32.exe shell32.dll,Control_RunDLL appwiz.cpl,,3
Function: Display the "Control Panel - Add/Remove Programs - Startup Disk" panel.
Command line: rundll32.exe syncui.dll,Briefcase_Create
Function: Create a new "My Briefcase" on the desktop.
Command line: rundll32.exe diskcopy.dll,DiskCopyRunDll
Function: Display the disk copying window
Command line: rundll32.exe apwiz.cpl,NewLinkHere %1
Function: Display the "Create Shortcut" dialog box, and the location of the created shortcut is determined by the %1 parameter.
Command line: rundll32.exe shell32.dll,Control_RunDLL timedate.cpl,,0
Function: Display the "Date and Time" option window.
Command line: rundll32.exe shell32.dll,Control_RunDLL timedate.cpl,,1
Function: Display the "Time Zone" option window.
Command line: rundll32.exe rnaui.dll,RnaDial
Function: Display the dial-up window of a certain dial-up connection. If a dial-up connection has been made, display the window of the current connection status.
Command line: rundll32.exe rnaui.dll,RnaWizard
Function: Display the window of the "New Dial-up Connection" wizard.
Command line: rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,0
Function: Display the "Display Properties - Background" option window.
Command line: rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,1
Function: Display the "Display Properties - Screen Saver" option window.
Command line: rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,2
Function: Display the "Display Properties - Appearance" option window.
Command line: rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,3
Function: Display the "Display Properties - Properties" option window.
Command line: rundll32.exe shell32.dll,SHHelpShortcuts_RunDLL FontsFolder
Function: Display the "Fonts" folder of Windows.
Command line: rundll32.exe shell32.dll,Control_RunDLL main.cpl @3
Function: Also display the "Fonts" folder of Windows.
Command line: rundll32.exe shell32.dll,SHformatDrive
Function: Display the format disk dialog box.
Command line: rundll32.exe shell32.dll,Control_RunDLL joy.cpl,,0
Function: Display the "Control Panel - Game Controllers - General" option window.
Command line: rundll32.exe shell32.dll,Control_RunDLL joy.cpl,,1
Function: Display the "Control Panel - Game Controllers - Advanced" option window.
Command line: rundll32.exe mshtml.dll,PrintHTML (HTML document)
Function: Print the HTML document.
Command line: rundll32.exe shell32.dll,Control_RunDLL mlcfg32.cpl
Function: Display the Microsoft Exchange general options window.
Command line: rundll32.exe shell32.dll,Control_RunDLL main.cpl @0
Function: Display the "Control Panel - Mouse" option.
Command line: rundll32.exe shell32.dll,Control_RunDLL main.cpl @1
Function: Display the "Control Panel - Keyboard Properties - Speed" option window.
Command line: rundll32.exe shell32.dll,Control_RunDLL main.cpl @1,,1
Function: Display the "Control Panel - Keyboard Properties - Language" option window.
Command line: rundll32.exe shell32.dll,Control_RunDLL main.cpl @2
Function: Display the Windows "Printers" folder.
Command line: rundll32.exe shell32.dll,Control_RunDLL main.cpl @3
Function: Display the Windows "Fonts" folder.
Command line: rundll32.exe shell32.dll,Control_RunDLL main.cpl @4
Function: Display the "Control Panel - Input Method Properties - Input Method" option window.
Command line: rundll32.exe shell32.dll,Control_RunDLL modem.cpl,,add
Function: Execute the "Add New Modem" wizard.
Command line: rundll32.exe shell32.dll,Control_RunDLL mmsys.cpl,,0
Function: Display the "Control Panel - Multimedia Properties - Audio" property page.
Command line: rundll32.exe shell32.dll,Control_RunDLL mmsys.cpl,,1
Function: Display the "Control Panel - Multimedia Properties - Video" property page.
Command line: rundll32.exe shell32.dll,Control_RunDLL mmsys.cpl,,2
Function: Display the "Control Panel - Multimedia Properties - MIDI" property page.
Command line: rundll32.exe shell32.dll,Control_RunDLL mmsys.cpl,,3
Function: Display the "Control Panel - Multimedia Properties - CD Music" property page.
Command line: rundll32.exe shell32.dll,Control_RunDLL mmsys.cpl,,4
Function: Display the "Control Panel - Multimedia Properties - Devices" property page.
Command line: rundll32.exe shell32.dll,Control_RunDLL mmsys.cpl @1
Function: Display the "Control Panel - Sound" option window.
Command line: rundll32.exe shell32.dll,Control_RunDLL netcpl.cpl
Function: Display the "Control Panel - Network" option window.
Command line: rundll32.exe shell32.dll,Control_RunDLL odbccp32.cpl
Function: Display the ODBC32 Data Source Administrator option window.
Command line: rundll32.exe shell32.dll,OpenAs_RunDLL{drive:\path\filename}
Function: Display the "Open With" dialog box for the specified file (drive:\path\filename).
Command line: rundll32.exe shell32.dll,Control_RunDLL password.cpl
Function: Display the "Control Panel - Password" option window.
Command line: rundll32.exe shell32.dll,Control_RunDLL powercfg.cpl
Function: Display the "Control Panel - Power Management Properties" option window.
Command line: rundll32.exe shell32.dll,SHHelpShortcuts_RunDLL PrintersFolder
Function: Display the Windows "Printers" folder. (Same as rundll32.exe shell32.dll,Control_RunDLL main.cpl @2)
Command line: rundll32.exe shell32.dll,Control_RunDLL intl.cpl,,0
Function: Display the "Control Panel - Regional Options Properties - Regional Settings" option window.
Command line: rundll32.exe shell32.dll,Control_RunDLL intl.cpl,,1
Function: Display the "Control Panel - Regional Options Properties - Numbers" option window.
Command line: rundll32.exe shell32.dll,Control_RunDLL intl.cpl,,2
Function: Display the "Control Panel - Regional Options Properties - Currency" option window.
Command line: rundll32.exe shell32.dll,Control_RunDLL intl.cpl,,3
Function: Display the "Control Panel - Regional Options Properties - Time" option window.
Command line: rundll32.exe shell32.dll,Control_RunDLL intl.cpl,,4
Function: Display the "Control Panel - Regional Options Properties - Date" option window.
Command line: rundll32.exe desk.cpl,InstallScreenSaver
Function: Set the specified screen saver file as the Windows screen saver and display the screen saver properties window.
Command line: rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,0
Function: Display the "Control Panel - System Properties - Legacy" property window.
Command line: rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,1
Function: Display the "Control Panel - System Properties - Device Manager" property window.
Command line: rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,2
Function: Display the "Control Panel - System Properties - Hardware Profiles" property window.
Command line: rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,3
Function: Display the "Control Panel - System Properties - Performance" property window.
Command line: rundll32.exe user.exe,restartwindows
Function: Forcefully close all programs and restart the computer.
Command line: rundll32.exe user.exe,exitwindows
Function: Forcefully close all programs and shut down the computer.
Command line: rundll32.exe shell32.dll,Control_RunDLL telephon.cpl
Function: Display the "Dial-up Properties" option window
Command line: rundll32.exe shell32.dll,Control_RunDLL themes.cpl
Function: Display the "Desktop Themes" option panel
Of course, not only Visual Basic, but also other programming languages such as Delphi, Visual C++ can use these functions of Rundll by calling external commands. The specific methods will not be described in detail here. Flexibly using Rundll will definitely make your programming easy and achieve twice the result with half the effort! The above content is taken from "Programming Technology"
|