Visual Basic System Services
Rundll32: Control Panel Functions A-C
Posted:   Friday September 17, 1999
Updated:   Monday December 26, 2011
Applies to:   VB4-32, VB5, VB6
Developed with:   VB4-32, Windows 95, VB6, Windows NT4
OS restrictions:   Win9x, NT4, 2000
Author:   VBnet - Randy Birch, Karl E. Peterson, Others (below)


Rundll32: Control Panel Functions A-C
Rundll32: Control Panel Functions D-F
Rundll32: Control Panel Functions G-J
Rundll32: Control Panel Functions K-N
Rundll32: Control Panel Functions O-R
Rundll32: Control Panel Functions S-Z
 Below:   - Control Panel -
Accessibility Properties
Add New Hardware Wizard
Add New Printer Wizard
Add/Remove Programs Property Page
Copy Disk Dialog
Create New Shortcut

The following are valid Windows 95/ Windows 98 (and for the most part, Windoes NT4 as well) control panel property page and wizard launch statements that will initiate the various control panel applets, and may also include the ability to specify the active tab on multiple-tabbed property pages. Some systems may not have all the control panel applets or related applications installed; on those systems executing the statement produce no result.

To immediately test the desired statement, use the Windows Run command from the start menu, and paste in the code line below. In a Visual Basic application, use the Shell function or similar routine to launch the control panel app. Maintaining commas, spaces and special characters is extremely important, so take care when pasting into a string in the Visual Basic environment. It may be advisable to first enter an empty string ("") and then paste into that to avoid VB reformatting the string as an expression.

If you are interested in an overview of the rundll and rundll32 interfaces as they apply to Win32 and NT4, Knowledge Base article Q164787 has been paraphrased here.


Control Panel
command: rundll32.exe shell32.dll,Control_RunDLL
result: displays all the Control Panel icons in an Explorer view

Accessibility Properties
module: ACCESS.CPL
command: rundll32.exe shell32.dll,Control_RunDLL access.cpl,,5
result: displays the Accessibility General properties
command: rundll32.exe shell32.dll,Control_RunDLL access.cpl,,1
result: displays the Accessibility Keyboard properties
command: rundll32.exe shell32.dll,Control_RunDLL access.cpl,,2
result: displays the Accessibility Sound properties
command: rundll32.exe shell32.dll,Control_RunDLL access.cpl,,3
result: displays the Accessibility Display properties
command: rundll32.exe shell32.dll,Control_RunDLL access.cpl,,4
result: displays the Accessibility Mouse properties

Add New Hardware Wizard
module: SYSDM.CPL
command: rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl @1
result: runs the Add New Hardware wizard

Add New Printer Wizard
module: SHELL32.DLL
command: rundll32.exe shell32.dll,SHHelpShortcuts_RunDLL AddPrinter
result: runs the Add New Printer wizard
comments: Windows NT, it is possible to bring up a predefined Windows Dialog box for connecting to a network printer - the ConnectToPrinterDlg API. However, this dialog is not accessible by Visual Basic programs running under Windows 95. Therefore, you must use a Command line equivalent statement to invoke the "Add Printer Wizard" under Windows 95 as detailed above. (KB article Q154007)

Add/Remove Programs Property Page
module: APPWIZ.CPL
command: rundll32.exe shell32.dll,Control_RunDLL appwiz.cpl,,1
result: displays the Install/Uninstall tab selected
command: rundll32.exe shell32.dll,Control_RunDLL appwiz.cpl,,2
result: displays the Windows Setup tab selected
command: rundll32.exe shell32.dll,Control_RunDLL appwiz.cpl,,3
result: displays the Startup Disk tab selected

module: SYNCUI.DLL
command: rundll32.exe syncui.dll,Briefcase_Create
result: Creates a new Briefcase on the desktop

Copy Disk Dialog
command: rundll32.exe diskcopy.dll,DiskCopyRunDll
result: displays the Copy Disk dialog for removable media

Create New Shortcut
module: APPWIZ.CPL
command: rundll32.exe apwiz.cpl,NewLinkHere %1
result: Displays the Create New Shortcut dialog. Completing the filename in the dialog creates a shortcut at the location specified by %1


PayPal Link
Make payments with PayPal - it's fast, free and secure!


Copyright 1996-2011 VBnet and Randy Birch. All Rights Reserved.
Terms of Use  |  Your Privacy



Hit Counter