Use RunDll32 utility [Topic]

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
abc0502
Posts: 1007
Joined: 26 Oct 2011 22:38
Location: Egypt

Use RunDll32 utility [Topic]

#1 Post by abc0502 » 29 Nov 2012 02:18

I Found a website, and it has a explanation of the RunDll32 utility,
it has a very cool usage like The blue screen of death that windows shows or the beep sound that you can
do using ascii "that never worked for me" or lock keyboard and mouse.

I only posted a few of the codes, the rest is here

Code: Select all

rundll32 shell32,OpenAs_RunDLL \dir\filename.txt                Open The 'Open With...' Window
rundll32 shell32,ShellAboutA Info-Box                           Open 'About Window Window' - works Windows 8
rundll32 shell32,Control_RunDLL desk.cpl                        Open Display Properties - works Windows 8
rundll32 user,cascadechildwindows                               Cascade All Windows
rundll32 user,tilechildwindows                                  Minimize All Child-Windows
rundll32 user,repaintscreen                                     Refresh Desktop
rundll32 keyboard,disable                                       Lock The Keyboard
rundll32 mouse,disable                                          Disable Mouse
rundll32 user32.dll,SwapMouseButton                             Swap Mouse Buttons - works Windows 8 - doesn't return the mouse to normal if run again!
rundll32 user32.dll,SetCursorPos                                Set Cursor Position To (0,0) - works Windows 8
rundll32 user,wnetconnectdialog                                 Show 'Map Network Drive' Window
rundll32 user,wnetdisconnectdialog                              Show 'Disconnect Network Disk' Window
rundll32 user,disableoemlayer                                   Display The BSOD (blue screen of death)Window
rundll32 diskcopy,DiskCopyRunDll                                Show Copy Disk Window
rundll32 rnaui.dll,RnaWizard                                    Run 'Internet Connection Wizard'
rundll32 shell32,SHFormatDrive                                  Run 'Format Disk (A)' Window
rundll32 shell32,SHExitWindowsEx -1                             Cold Restart Of Windows Explorer
rundll32 shell32,SHExitWindowsEx 1                              Shut Down Computer
rundll32 shell32,SHExitWindowsEx 0                              Logoff Current User
rundll32 rnaui.dll,RnaDial "MyConnect"                          Run 'Net Connection' Dialog
rundll32 msprint2.dll,RUNDLL_PrintTestPage                      Choose & Print Test Page Of Current Printer
rundll32 user,setcaretblinktime                                 Set New Cursor Rate Speed
rundll32 user, setdoubleclicktime                               Set New DblClick Speed (Rate)
rundll32 sysdm.cpl,InstallDevice_Rundll                         Hardware installation wizard
rundll32 user,MessageBeep                                       Default beep sound
rundll32 user32.dll,MessageBeep                                 Default beep sound (XP)
rundll32 shell32.dll,Control_RunDLL odbccp32.cpl                ODBC settings
Rundll32.exe powrprof.dll,SetSuspendState Sleep                 Put the computer in Sleep mode

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Use RunDll32 utility [Topic]

#2 Post by foxidrive » 29 Nov 2012 02:27

Thanks, that's useful.

abc0502
Posts: 1007
Joined: 26 Oct 2011 22:38
Location: Egypt

Re: Use RunDll32 utility [Topic]

#3 Post by abc0502 » 29 Nov 2012 02:34

I tested few of them but they don't work :?
Even the Blue screen of death :cry: it could have been a very cool trick :twisted:

it keep saying "The specified module couldn't be found"

But at least the 2nd beep is working :lol:

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Use RunDll32 utility [Topic]

#4 Post by foxidrive » 29 Nov 2012 04:43

I tried it just now too and it seems to be a bit fragmented and case is significant. Of the following tries only the last one worked.

So changing user to user32.dll and adding uppercase to word boundaries might work.


d:\>rundll32 user,setcursorpos

d:\>rundll32 user,SetCursorPos

d:\>rundll32 user32.dll,setcursorpos

d:\>rundll32 user32.dll,SetCursorPos
Only this one worked

abc0502
Posts: 1007
Joined: 26 Oct 2011 22:38
Location: Egypt

Re: Use RunDll32 utility [Topic]

#5 Post by abc0502 » 29 Nov 2012 05:05

The Writer posted
Note that they are not guaranteed to work across all Windows versions.

and there was on of these commands that work for window 9x so i think this is old post, i couldn't find any date but as you said converting user to User32.dll work in few of these commands including the one in the link

miskox
Posts: 553
Joined: 28 Jun 2010 03:46

Re: Use RunDll32 utility [Topic]

#6 Post by miskox » 29 Nov 2012 09:52

Here is one cool trick I use to change wallpaper from batch:

Code: Select all

rundll32.exe user32.dll,UpdatePerUserSystemParameters


And how I use it in a batch file:

Code: Select all

@echo off
echo Waiting 10 seconds before changing wallpaper...
ping -n 10 -w 1000 127.0.0.1>nul 2>nul

echo Windows Registry Editor Version 5.00>temporary.reg
echo.>>temporary.reg
echo [HKEY_CURRENT_USER\Control Panel\Desktop]>>temporary.reg
echo "Wallpaper"="C:\\WINDOWS\\Web\\Wallpaper\\Bliss.bmp">>temporary.reg

regedit /s temporary.reg && del temporary.reg

rundll32.exe user32.dll,UpdatePerUserSystemParameters

if exist temporary.reg del temporary.reg
exit


The code above changes the wallpapper from the current one to the Bliss.bmp.

Saso

abc0502
Posts: 1007
Joined: 26 Oct 2011 22:38
Location: Egypt

Re: Use RunDll32 utility [Topic]

#7 Post by abc0502 » 29 Nov 2012 13:52

Thanks, :) that is a nice trick to do in some. and could be to change wallpaper every moment randomly using a batch foxidrive made once to randomly start files.

Post Reply