Have you ever wondered how people find out shortcuts and command lines on how to open Computer Management, System Properties, Device Manager and etc? Do they actually find out themselves or it is documented in Microsoft Knowledge Base? Or maybe Microsoft employees/programmers revealed it?
An example is an article on how to open Safely Remove Hardware dialog box when the icon is not located at the tray bar which I published 2 days ago. Just run the command line rundll32 shell32.dll,Control_RunDLL hotplug.dll and the Safely Remove Hardware dialog box will appear. As you’ve noticed, it’s not as easy as running a single executable file. It involves rundll32.exe, shell32.dll, the command Control_RunDLL and hotplug.dll. Who could have figured that out?
You will know how to unveil the shortcuts and commands yourself after you’ve finished reading this tutorial.
Actually it’s pretty easy. There’s a popular tool called Process Explorer from Sysinternals which can reveal information about which handles and DLLs processes have opened or loaded. At first I thought Process Explorer is just another task manager program, maybe it’s slightly more powerful than Windows Task Manager but I was wrong. When I explored Process Explorer deeper, I found that it’s VERY powerful.
Anyway, here is how I found out the command line for Safely Remove Hardware dialog box.
1. Run Process Explorer
2. Open Safely Remove Hardware dialog box by right clicking on the tray icon and select “Safely Remove Hardware”
3. You will notice that a new process has been added to Process Explorer and it’s green in color for a second. Double click the process to see the process properties.

4. At the Image tab, you’ll see Command Line. That’s the command line that will open Safely Remove Hardware dialog window.

5. To confirm that it is the shortcut command line for Safely Remove Hardware dialog box, copy the command and paste it to Run. If it opens Safely Remove Hardware dialog box, you got it right! If not, it must be another rundll32.exe process.
Using this method you can find out any and all shortcuts you want. I’ve tried on Computer Management, System Properties, Device Manager and I am able to find the command line shortcuts. If Process Explorer unable to capture the process, that means there is no command line for it. An example is My Computer. When you open My Computer, Process Explorer doesn’t capture anything.
Related posts:
I have an exe, and I run 3 different instances of it, holding diffent proc IDs. I would like to have the CommandLine info for each of this PID which I can see in the ProcExec. But I would like to get this info in my program. How do I get this CommandLine info available with the proc exec within my program ?
Thank you in advance
Asnwer to #12, this can be done with microsoft’s devcon tool (device console)
First find out under which device name your external harddisk registers itself
c:\>devcon status * | find “DISK” should get you pretty close.
in my case:
USBSTOR\DISK&VEN_HTS54808&PROD_0M9AT00&REV_0811\6&9F900F5&0 (will be different is you use external sata or firewire harddisks)
You need the portion upto the first & ; USBSTOR\DISK
To disconnect:
devcon disable USBSTOR\DISK
to reconnect:
devcon enable USBSTOR\DISK
hope this helps
I haven’t tried with multiple usb disks attached though.
Please answer # 12 above. It was a good question, and I have the same question.
Quote:
Hey i want to be able to make a script to disconnect my external HDD. the command “RunDll32.exe shell32.dll,Control_RunDLL hotplug.dll” is all good but that only brings up the “safely remove hardware” box. Can you help me out by telling me how to specify a drive to disconnect instead of clicking “stop device” on the drive?
e.g. If my HDD was “F:” what would be script be??
Wah, macam itu ka? Ic2.. Thank you.
Hey i want to be able to make a script to disconnect my external HDD. the command “RunDll32.exe shell32.dll,Control_RunDLL hotplug.dll” is all good but that only brings up the “safely remove hardware” box. Can you help me out by telling me how to specify a drive to disconnect instead of clicking “stop device” on the drive?
e.g. If my HDD was “F:” what would be script be??
Hi there! I keep getting the same error message: Windows – drive not ready Exception Processing Message c00000a3 Parameters 75b6bf9c 4 75b6bf9c 75b6bf9c
when i try to use my TUNE TRANSFER program to move some songs from my ipod to my itunes. Everytime i turn on the program and try to detect my ipod, it gives me the error and won\’t acknowledge my ipod. I\’ve uninstalled and reinstalled it with the same results, i\’ve also uninstalled and reinstalled itunes but nothing yet. PLEASE HELP!!!
[...] is. You can either use Windows search to look for *msconfig* or go to another computer, use Process Explorer to find the path to MSConfig. As you can see, Process Explorer clearly shows that MSConfig.exe is [...]
Really smart trick.
Thanks, Ray
Yeah smasher007, you can make a shortcut for the command :)
smasher007 : yup, i put a shortcut, paste the command there and change the icon… then double click on the shortcut and the safely remove hardware box will pop up
Good tip, thanks man!
Hey..! Nice ..!
By this command line, can we make a shortcut on the desktop to safely remove the hardware? just double click on the dektop shortcut and we can remove the USB? Is this possible?
I am using Windows Xp with service 2. Every time I start my system get the following Error:
Windows – Drive Not Ready
Exception Processing Message c00000a3 Parameters 75b6bf9c 4 75b6bf9c 75b6bf9c
Cancel Try Again Continue
Please help me diagnose what is going wrong. There is no CD in my CD drive.
Thanks
really useful… like it
Oye, gracias por el gran dato. Me va a servir de mucho. Yo también pensaba que el Process Explorer era otro administrador de tareas de Windows pero ya veo que no.
Gracias una vez más.
P.D.: Oye, mucho mejor el diseño de tu página. Me gusta más que el anterior. ;)
Thanks for the Pretty information Roymaond .