Trouble and Fun with Rundll & Rundll32

Rundll.exe and Rundll32.exe are utility programs that can execute functions in DLLs. For instance, you can type the following command at the command line (no space after the comma):

Rundll32 user,ExitWindows

This means: Rundll32.exe will execute the function ExitWindows from the library User.exe. When you press enter to execute this command, Windows will shut down. It can be interesting to create a shortcut for such a command.

With the next command Windows will shutdown, your computer will reboot and Windows will restart:

Rundll32 shell32.dll,SHExitWindowsEx 2

The trouble with Rundll and Rundll32 is that the functions they can execute are undocumented. There are a few comprehensive lists of the Windows API, but those functions cannot be executed by Rundll(32)--and vice versa.

You can look for Rundll commands in the Registry, especially in HKEY LOCAL MACHINE\Software\Classes, or, as another way to find the same commands, by using Explorer: click Folder options in the View Menu, switch to the File Types tab and select a file type. The File Type details will tell you which program opens the selected type.

In quite a number of cases, the program will be Rundll or Rundll32. You can click Edit to check out the command.

More Rundll commands, usually of the more or less incomprehensible kind, can be found in the numerous INF files on your hard drive.

There are some useful Rundll commands to speed up your access to Control Panel items.

ERRORS with RUNDLL and RUNDLL32

If you get error messages with Rundll or Rundll32, you should first make sure if they are random or not. "Random" means that the errors are caused in different files or applications. This could mean that one of the Rundll files is corrupt. If the error is caused in the same file over and over (likely candidates are for instance Setupapi.dll, Setupx.dll, Rnaui.dll and Shell32.dll), this file could be the culprit. To replace a corrupt file, extract it from the Windows CD. Rundll and Rundll32 must be extracted to your Windows folder.

Hard to fix are Rundll errors during Windows setup, mostly after the second reboot. No real "fix" here: pressing the Reset button of your computer is usually the only way out, and sometimes the error will reproduce, forcing you to reset fifty times, untill suddenly the error stays away. Not a real solution and demanding on your patience, but it almost always works out in the end.