Open Devices and printers window in batch?
Asked Answered
N

3

5

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

Niggardly answered 23/8, 2014 at 19:18 Comment(0)
L
9

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 }
Lilliamlillian answered 23/8, 2014 at 19:27 Comment(3)
Does this work for different languages? One single shortcut and does it work for xp and 7?Niggardly
Yes it works on Windows XP. This will work for any language that can communicate with shell. For example, PHP's shell_exec.Lilliamlillian
If you want a more concrete approach (one that does not require a file to be created), you can check out the edit.Lilliamlillian
W
5

Simple Run or CMD Command:

control printers

enter image description here

Waksman answered 9/11, 2018 at 7:17 Comment(0)
G
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
Glennglenna answered 18/5, 2016 at 19:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.