5

How do I open the Devices and printers tab in the control panel with batch or from the command prompt?

Arbitur
  • 38,684
  • 22
  • 91
  • 128

3 Answers3

8

Take a look at the CLSID Key (GUID) listing.

With shell, you can execute code to open the control panel to the desired location.

explorer shell:::{CLSID key number below}

In this case, your code would be:

explorer shell:::{A8A91A66-3A7D-4424-8D24-04E180695C7A}

Alternatively:

Open Control Panel -> Hardware and Sound, left click and drag Devices and Printers to the desktop, this will create a new shortcut to that location.

With the shortcut, you can run it within a command prompt or a shell alternative.


Both methods do the exact thing, opening the lnk in notepad reveals the location of:

{ 2 6 E E 0 6 6 8 - A 0 0 A - 4 4 D 7 - 9 3 7 1 - B E B 0 6 4 C 9 8 6 8 3 } \ 2 \ : : { A 8 A 9 1 A 6 6 - 3 A 7 D - 4 4 2 4 - 8 D 2 4 - 0 4 E 1 8 0 6 9 5 C 7 A }
Dave Chen
  • 10,887
  • 8
  • 39
  • 67
  • Does this work for different languages? One single shortcut and does it work for xp and 7? – Arbitur Aug 23 '14 at 19:34
  • Yes it works on Windows XP. This will work for any language that can communicate with shell. For example, PHP's [shell_exec](http://php.net/manual/en/function.shell-exec.php). – Dave Chen Aug 23 '14 at 19:35
  • If you want a more concrete approach (one that does not require a file to be created), you can check out the edit. – Dave Chen Aug 23 '14 at 19:47
5

Simple Run or CMD Command:

control printers

enter image description here

Hossein Golshani
  • 1,847
  • 5
  • 16
  • 27
Fuad ALiyev
  • 51
  • 1
  • 2
1

A lot of the Control Panel apps in Windows that are using an Explorer UI can actually be launched quite easily as so:

control /name Microsoft.<name_of_app>

For example, you can do this:

control /name Microsoft.DevicesAndPrinter
control /name Microsoft.Display

Also, using rundll32.exe is another common way to open *.cpl apps. But that is a bit trickier and cryptic. Here's how you could open the Playback Devices view in the Sounds control panel:

rundll32.exe shell32.dll,Control_RunDLL mmsys.cpl,,playback
Chef Pharaoh
  • 2,387
  • 3
  • 27
  • 38