I have an old industrial PC with windows 95/98 installed. For some reason I need to have an script or utility which can disable, wait for few seconds and then enable a device (serial port controller). I can do it manually using Windows Device Manager, checking 'Disable in this hardware profile' checkbox, pushing OK, then unchecking this checkbox. Is there any way to do this from command line or maybe with WinAPI? Thanks.
Asked
Active
Viewed 431 times
1 Answers
-1
You can do this via registry!
When you disable hardware, a key for it will appear in HKEY_CURRENT_CONFIG/Enum/[BUS NAME]/[HARDWARE IDS]/[DEVICE IDS]
with a CSConfigFlags
value of 01 00 00 00
. This value changes to 00 00 00 00
when you enable the device back.
You can export two .reg
files and use command line to apply them to the registry

Sos Sosowski
- 157
- 3