Below are examples of how the rundll.exe rundll32.exe files can be used in Microsoft Windows to perform Windows commands from the command prompt. Because of the different versions of rundll and rundll32, not all of the options below work. If rundll or rundll32 encounter an error, the command fails without any error messages.

Shutdown, restart, logoff, or poweroff the computer

The shutdown, restart, logoff, and poweroff functions can be accessed in commands or scripts with the rundll32.exe and shell32.dll files in Microsoft Windows.

  • How to shut down or restart the computer with a batch file.

Lock the Windows 2000 and Windows XP workstation

To lock a Windows 2000 or Windows XP computer, run the following command.

rundll32 user32.dll,LockWorkStation

Run the install for an inf file

Run the install for an inf file.

rundll32.exe setupapi,InstallHinfSection DefaultInstall 132

Open the “Open with” folder for a file

Below is a command to open the Open with window for a file.

rundll32.exe shell32.dll,OpenAs_RunDLL

Run copy disk program

Below is an example of how the copy disk window can be opened from the command line.

rundll32.exe diskcopy,DiskCopyRunDll

Create a new shortcut

Open the create shortcut wizard icon by typing the command below into the command prompt. The “NewLinkHere” is case sensitive and generates an error if not typed in properly.

rundll32.exe appwiz.cpl,NewLinkHere

Open the screen saver window

rundll32.exe desk.cpl,InstallScreenSaver

  • See our restart, shortcut, and shutdown definition for further information and related links.
  • Microsoft Windows help and support.