Simplify DLL-encapsulated administrative functions
Many common administrative functions in Windows are encapsulated in DLLs. This design lets multiple executable programs share certain functions but prevents users from directly executing functions that DLLs contain. Fortunately, Windows provides a command-line utility, Rundll32, that lets you execute some DLL functions. Here are 10 Rundll32 shortcuts to common administrative functions.
10. Open Microsoft Internet Explorer (IE) to a specific Web site. For example, to launch IE and open the Windows & .NET Magazine Web site, simply enter the following command:
rundll32.exe url.dll,
FileProtocolHandler http://www.winnetmag.com
9. Add a printer to a remote computer. Rundll32 can launch the Add Printer Wizard for a local or remote computer. The following example starts the Add Printer Wizard for remote computer teca4. (To start the Add Printer Wizard for a local computer, omit the /c switch.)
rundll32.exe printui.dll,
PrintUIEntry /il
/c\\teca4
8. Add printer ports for attached TCP/IP printers. The following command starts the Add TCP/IP Printer Port Wizard:
rundll32.exe tcpmonui.dll,
LocalAddPortUI
7. Start the Network Identification Wizard. The following command starts the wizard, which steps you through your initial networking setup and lets you specify the computer name, logon domain, logon ID, and password:
rundll32.exe netplwiz.dll,
NetAccWizRunDll
6. Run the Network Place Wizard. This wizard lets you add a link to a network storage location. The link can access a network share, an FTP location, or a Web folder. Enter this command to start the wizard:
rundll32.exe netplwiz.dll,
AddNetPlaceRunDll
5. Create a new shared folder. Another handy administrative function that Rundll32 can perform is launching the New Share dialog box, which lets you graphically add network shares. Simply enter the following command:
rundll32.exe ntlanui.dll,
ShareCreate
4. Manage network shares. Use the following command to launch the Shared Directories dialog box. You can use this dialog box to list your system's network shares, add a new share, toggle sharing on and off, and change share permissions:
rundll32.exe ntlanui.dll,
ShareManage
3. Launch Device Manager. To quickly run Device Manager without first navigating through the Administrative Tools folder, run Rundll32 as follows:
rundll32.exe devmgr.dll DeviceManager_Execute
2. Lock your workstation. Rundll32 can also perform various shell functions. For example, you can add an icon to your desktop that you can use to immediately lock your workstation. To do so, right-click on the desktop and select New, Shortcut. In the Command line text box, enter the command
rundll32.exe user32.dll,
LockWorkStation
1. Automatically log off a user or shut down your machine. You can incorporate Rundll32 into your Windows Script Host (WSH) or command-shell scripts to log off the current user or shut down and restart the computer. The value in the command's last parameter controls the action that will occur: 0 performs a logoff, 1 performs a shutdown, 2 performs a reboot, 4 performs a forced shutdown, and 8 powers down the machine. The following example performs a logoff:
rundll32.exe shell32.dll,
SHExitWindowsEx 0
That one being the most useful, it would be great if it was corrected? Thank You!
Dave Namou June 28, 2002