RUNDLL32 SHELL32.DLL,Control_RunDLL filename.CPL,@n,t
where | filename.CPL | is the name of one of Control Panel's *.CPL files, | ||
n | is the zero based number of the applet within the *.CPL file, and | |||
t | is the number of the tab for multi paged applets |
RUNDLL32 SHELL32.DLL,Control_RunDLL TIMEDATE.CPL,@0,1
RUNDLL32 SHELL32.DLL,Control_RunDLL DESK.CPL,@0,1
RUNDLL32 SHELL32.DLL,Control_RunDLL NCPA.CPL,@0,2
RUNDLL32 SHELL32.DLL,Control_RunDLL NCPA.CPL,@0,3
RUNDLL32 SHELL32.DLL,Control_RunDLL SYSDM.CPL,@0,2
RUNDLL32 DESK.CPL,InstallScreenSaver C:\WINNT\SYSTEM32\Default.scr
The directory shown is for Windows NT, adjust for Windows 95/98
RUNDLL32 SHELL32.DLL,SHHelpShortcuts_RunDLL AddPrinter
RUNDLL32 SHELL32.DLL,SHFormatDrive
RUNDLL SHELL32.DLL,SHExitWindowsEx
RUNDLL SHELL32.DLL,SHExitWindowsEx 4
RUNDLL32 USER32.DLL,ExitWindowsEx
RUNDLL USER.EXE,ExitWindowsExec
RUNDLL SHELL32.DLL,SHExitWindowsEx 2
@ECHO OFF
PUSHD %temp%
ECHO [Version] > {out}.inf
ECHO signature=$chicago$ >> {out}.inf
ECHO [defaultinstall] >> {out}.inf
RUNDLL32 SETUPAPI,InstallHinfSection DefaultInstall 1 {out}.inf
DEL {out}.inf
POPD
(original batch file by Walter Zackery, adapted for
readability)
RUNDLL USER.EXE,ExitWindows
RUNDLL SHELL32.DLL,SHExitWindowsEx 1
RUNDLL SHELL.DLL,RestartDialog
RUNDLL32 SHELL32.DLL,ShellAboutW
RUNDLL32 SHELL32.DLL,OpenAs_RunDLL filename
RUNDLL USER.EXE,SwapMouseButton
RUNDLL32 USER32.DLL,SwapMouseButton
CONTROL MAIN.CPL
or:
RUNDLL32 SHELL32.DLL,Control_RunDLL MAIN.CPL,@0,1
START RUNDLL32 RNAUI.DLL,RnaDial exact name of dialer entry
TRACERT -h 1 -w 1
The RUNDLL command starts DUN, the TRACERT command is supposed
to actually start the dialing process. Since I do not have access to any PC
with DUN installed, I could not test the TRACERT command's effect.
Notes: | 1 | See my Shutdown page for more information and examples on reboot and shutdown command lines. | ||
---|---|---|---|---|
2 | By associating *.CPL files with the commandRUNDLL32 SHELL32.DLL,Control_RunDLL %1,@0 and *.SCR files with RUNDLL32 DESK.CPL,InstallScreenSaver %1 you can open and/or install them by doubleclicking on their icons. |
The following batch file installs a screensaver if one is specified, and
opens the Control Panel applet at the right tab to enable adjustment of its
settings (tested in NT only):
@ECHO OFF
IF "%1"=="" GOTO Interact
IF NOT EXIST %SystemRoot%.\System32\%~nx1 GOTO Interactive
RUNDLL32 DESK.CPL,InstallScreenSaver %~f1
GOTO End
:Interactive
RUNDLL32 SHELL32.DLL,Control_RunDLL DESK.CPL,@0,1
:End
OS (1) | Command line | Effect |
---|---|---|
DOS | ECHO G=FFFF:0000 ¦ DEBUG |
Reboot (warm boot, sometimes cold boot)(2) |
Win31* | ECHO G=FFFF:0000 ¦ DEBUG |
Popup Task Manager, sometimes reboot |
Win9* | RUNDLL USER.EXE,ExitWindows |
Shutdown (3) |
Win9* | RUNDLL USER.EXE,ExitWindowsExec |
Win95: various results, usualy fast shutdown (and lock PC),
sometimes restart Windows, sometimes reboot. Win98: Restart Windows, sometimes reboot. |
Win9* | RUNDLL SHELL.DLL,RestartDialog |
"System Settings Change, Do you want to restart your computer now?" dialog |
Win98 | RUNDLL
SHELL32.DLL,SHExitWindowsEx |
Logoff (4) |
Win98 | RUNDLL
SHELL32.DLL,SHExitWindowsEx 1 |
Shutdown |
Win98 | RUNDLL
SHELL32.DLL,SHExitWindowsEx 2 |
Reboot |
Win98 | RUNDLL
SHELL32.DLL,SHExitWindowsEx 4 |
Logoff, and start Explorer after relogon |
NT | See Reboot NT on my Solutions found in alt.msdos.batch page | Reboot immediately |
NT | RUNDLL32
USER32.DLL,ExitWindowsEx |
Logoff |
NT+RK | SHUTDOWN /L /T:10 /Y /C |
Shutdown in 10 seconds, close without saving |
NT+RK | SHUTDOWN /L /R /T:0 /Y |
Immediate shutdown & reboot |
Kix | $RC = SHUTDOWN(
"\\server", "Shutting down...", 10, 1, 0 ) |
Shutdown in 10 seconds, with message, close without saving, no reboot |
Kix | $RC = SHUTDOWN(
"\\server", "", 0, 1, 1 ) |
Immediate shutdown & reboot |
Kix | $RC = LOGOFF( 1 ) |
Logoff, forcing applications to close (use 0 instead of 1 if you don't want to force applications to close) |
OS/2 | START /PM SHUTDOWN
&& EXIT |
Shutdown (5) |
OS/2 | SETBOOT /IBD:C: |
Unconditional shutdown & reboot |
OS/2 | SETBOOT /IBA:nonsense |
Unconditional shutdown & failing reboot (6) |
OS/2 | LOGOFF |
Logoff (both LAN Server client and Peer) |
Notes: | 1 | DOS | MS-DOS and PC-DOS | |
---|---|---|---|---|
Win31* | Windows 3.1, 3.11 and 3.11 for Workgroups | |||
Win9* | Windows 95 and 98 | |||
Win98 | Windows 98 | |||
NT | Windows NT 4 (and Windows 2000) | |||
NT+RK | Windows NT 4 with the NT Resource Kit | |||
Kix | Windows (any) with Kix | |||
OS/2 | OS/2 Warp 3 and 4, LAN Server and Warp Server | |||
2 | May not work with "exotic" memory managers, like Quarterdeck's QEMM or DesqView; in that case, use RESET.COM instead. | |||
3 | Thanks for Bill James and Tom Lavedas, for the information
on RUNDLL. Find more RUNDLL examples I collected on my RUNDLL page. |
|||
4 | Tested parameters for RUNDLL SHELL32.DLL,SHExitWindowsEx |
|||
Parameter | Result | |||
none | Logoff | |||
0 | Logoff | |||
1 | Shutdown | |||
2 | Reboot | |||
3 | Reboot | |||
4 | Logoff, and start Explorer after relogon | |||
5 | Shutdown | |||
6 | Reboot | |||
7 | Reboot | |||
8 | Logoff | |||
This pattern then seems to repeat itself: 8 equals 0, 9
equals 1, etcetera. Letters are invalid, and are ignored (equal to none). |
||||
5 | Will still stop and ask for confirmation if a non-PM application is active | |||
6 | Needs Boot Manager installed. Will reboot, no questions asked, and then stop if nonsense is an invalid Boot Manager menu entry (which, in this case, is exactly what we want). |
3562 » Undocuments paths to Windows 2000 tools.In addition to tip 3557, Jeffrey W. Horning has provided the following undocumented paths to windows 2000 tools:Manage Shares : rundll32 ntlanui.dll,ShareManage - Shares Create a New Hhare : rundll32 ntlanui.dll,ShareCreate Add a TCP/IP Printer : rundll32 tcpmonui.dll,LocalAddPortUI Install New Modem : rundll32 modemui.dll,InvokeControlPanel Execute Device Manager : rundll32 devmgr.dll DeviceManager_Execute Network Id Wizard : rundll32 netplwiz.dll,NetAccWizRunDll Add Network Place : rundll32 netplwiz.dll,AddNetPlaceRunDll |
Shortcut to lock the Computer / Workstation in Windows 2000 - C:\WINNT\system32\rundll32.exe user32.dll,LockWorkStation