Is there any way to disable and enable device in windows 95/98?

593 views Asked by At

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.

1

There are 1 answers

0
Sos Sosowski On

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