How to open the "Devices and Printers" panel in Windows 8 via CLI or AHK?

I would like to automate the connection of a PC to a telephone Internet connection via Bluetooth using an AutoHotKey script that will do the following:

Bluetooth internet connecting UI sequence

When the Devices and Printers window is open, I should be able to perform most of the actions by sending keystrokes.

Now the question is:

In Windows 7, Devices and Printers can be opened using the command line

control bthprops.cpl 

but in Windows 8 the same command opens the "Modern User Interface" screen PC Settings> Devices instead of the above window. Is there a way to open this window programmatically, either through the command line or through a DLL call?

+6
source share
1 answer

OK, after some further research, I found a working command:

 control printers 

It opens the Devices and Printers window, containing not only Bluetooth devices, but also all known devices. Thus, the contents of the window are a superset of the content requested in the question, but the only difference is that Bluetooth device filtering is not applied this time. Entering the name of the device moves the focus of the selection to its element, and nothing prevents the launch of a command from the context menu of the device. Thus, the full script for the MyPhone1 model device:

 Run, control printers WinWaitActive, Devices and Printers Sleep, 500 Send MyPhone1{AppsKey}ca 

And AutoHotKey is activated again. :)

Edit: According to MCL's comment, the ugly wait loop has been replaced with a sleek WinWaitActive . Thanks!


EDIT:

from the command line:

  • devices and printers:

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

     explorer shell:::{28803F59-3A75-4058-995F-4EE5503B023C} 
  • other locations:

    โ–ถ list on eightforums.com

+8
source

All Articles