How to disable/enable a system device?

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
ineedh3lp
Junior Coder
Posts: 26
Joined: Thu Nov 04, 2010 1:11 am

How to disable/enable a system device?

Post by ineedh3lp » Thu Jan 20, 2011 11:48 am

Hello!

I am wondering, can someone provide a script (or help me creating one) for disabling/enabling a system device using a MacroScheduler script?

So, instead of me having to go to Computer Management > Device Manager, select a device, right click and disable/enable it I would like to use a script that would quickly do that for me (without the need of a graphical user interface).

Thank you in advance.

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Jan 20, 2011 1:38 pm

Download DevCon whch is a command line version of device manager:

http://support.microsoft.com/kb/311272

Then you can do something like:

Run>devcon.exe disable bla

Run>devcon.exe enable bla
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

ineedh3lp
Junior Coder
Posts: 26
Joined: Thu Nov 04, 2010 1:11 am

Post by ineedh3lp » Thu Jan 20, 2011 4:38 pm

Thank you! Exactly what I was looking for.

idiot
Macro Veteran
Posts: 152
Joined: Thu Mar 01, 2007 9:21 am

Post by idiot » Wed Jan 26, 2011 2:00 am

without needing to download anything click start menu click run type "msconfig" with out the qoutes
this will bring up the system menu this is also how you stop programs from running on start up and slowing boot time
if idiots rule the world then im the king!!!!
i want a free t-shirt give me all of your rep!!!
please give me pro version of macro scheduler and appnavigator!!!

ineedh3lp
Junior Coder
Posts: 26
Joined: Thu Nov 04, 2010 1:11 am

Post by ineedh3lp » Wed Jan 26, 2011 5:58 am

idiot wrote:without needing to download anything click start menu click run type "msconfig" with out the qoutes
this will bring up the system menu this is also how you stop programs from running on start up and slowing boot time
That wasn't what I asked for.

I want to disable and re-enable a device (during the same session), not services and applications. As for the boot time I'd get a SSD to speed it up, I wouldn't disable services and applications that are started because they are being used (not to mention I roughly restart the PC once a month).

Either way, thanks for the input, idiot.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts