Disable USB Connected Digital Picture Frame - image

Is it possible to disable & enable a USB connected digital picture frame in a windows batch file? I am currently using the DEVCON Enabhle/disable command & that does make the unit not shown as a drive & shows USB disabled in the Device Manager but the actual frame still thinks its connected. It is not until the frame is turned off/on or the USB cable is removed that it act like its not connected.
Here is my current program.
devcon enable *DEV_24CD
devcon enable *DEV_24C2
devcon enable *DEV_24C4
copy C:\Pic_Frame\Br_Frame\*.* E:\ /y
copy C:\Pic_Frame\Blk_Frame\*.* I:\ /y
del C:\Pic_Frame\Br_Frame\*.* /q
del C:\Pic_Frame\Blk_Frame\*.* /q
devcon disable *DEV_24CD
devcon disable *DEV_24C2
devcon disable *DEV_24C4
I understand this maybe an issue with the frame, but hoped there was something on the PC I was missing.
Thanks in advance.
Andy

If you need the USB device to know it's disconnected you should have it reenumerate on the bus, which would mimic unplugging and plugging in USB, or possibly the on/off toggle in your case.
Instead of devcon disable issue devcon remove to disable and remove the device from the system completely. Then use devcon rescan to get it to reenumerate again. Depending on what you are trying to do you might need to use a combination of these and your original enable/disable commands.

Related

Reset wireless adapter automatically

I have a windows 7 laptop that I am running continuously on wireless internet connect. But sometimes, there are problems with my wireless connection so I have to right click on the wireless connection icon and troubleshoot the problem. Is there a way I could automatically troubleshoot wireless problems with a batch file or windows task scheduler.
Regards
Get devcon
Perform devcon find *
Copy USB\VID_****\PID_**** or PCI\VEN_****\DEV_**** (according BUS type) string for your wireless adapter
Create batch containing line: devcon restart "Your_copied_string"

How to disable serial port using devcon

I am trying to disable usb-serial ch340 port using devcon as shown in picture. I tried following commands devcon disable usb*, devcon disable com* as shown in picture but did not work. How can I disable it.
This may be much too late, but I just had and solved the same message.
The solution was to open cmd as an administrator and call
devcon disable usb*
This will definitely work, (PID_1016 this is just an example).
devcon.exe disable *PID_1016

my usb is not accessible "The request could not be performed because of an I/O device error"

i`m trying to open my USB and i have the message drive is not accessible. The request could not be performed because of an I/O device error
Try this Easy step. It will be work for you.
Type CMD on your system search bar.
Right click and choose "Run as administrator".
Type chkdsk /f [Drive:]. Replace the [Drive:] to your removable drive letter. For e.g: If your USB drive letter is G:, then type chkdsk /f G:
Press "Enter" button to execute that command.
Now your USB can works fine and you can able to copy & paste your data.

How to change usb adapter properies by command ? Windows 7

I want to change the "wireless Network Connection 2"
"wireless mode" in device properties. How can it be done by command - to be automated (passable using tcl)?
I also tried to change the registry key that follow the configuration but, comparing to older devices, it did nothing to the device! even after disable-enable or reboot the PC. TNX –

Detect all connected monitors using Windows API

I am using Windows 7. When I plug a new monitor when the PC is running, the monitor is not automatically detected. I must go to the Display->Screen Resolution and click on the Detect button in order to detect the monitor with the registry configuration.
I am searching for a way to do the same programmatically using the Windows API. So I would like to write a program that detects all connected monitors reproducing the Detect button. I tried using ChangeDisplaySettingEx but with bad results. Any suggestions?
Not really a WinApi but try this utility:
C:\Windows\System32\DisplaySwitch.exe
DisplaySwitch.exe /internal - Switch to Primary only
DisplaySwitch.exe /external - Switch to Secondary only
DisplaySwitch.exe /clone - Clone desktop on both screens (Not HDCP compliant!)
DisplaySwitch.exe /extend - Extend desktop to both screens
In particular, try /extend switch, it should perform detection internally.
Not an API solution, but you can use MS's DevCon utility on the command line to scan for new hardware.
https://support.microsoft.com/en-us/kb/311272
Download it from that page, then just execute this from a cmd window:
devcon.exe rescan
You can easily create a .bat or .cmd file to run this from a link.
You should read this if you want to learn about display-aware apps.

Resources