Solved

VB Script to disable a device in device manager XP

Posted on 2011-09-15
5
347 Views
Last Modified: 2012-05-12
Does anyone know if it is possible to use just a vb script to disable a device in device manager on Win XP SP2? If so, do you have a sample to put me on the path? -Thanks
0
Comment
Question by:Willing2Learn_More
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 65

Accepted Solution

by:
RobSampson earned 500 total points
ID: 36546865
To my knowledge, there are no WMI classes that support a similar function to the Device Manager.  You will need to use devcon:
http://support.microsoft.com/kb/311272

For example, with devcon.exe copied to your System32 folder, you could run this VBScript:
strCommand = "cmd /c devcon disable *MSLOOP"
Set objShell = CreateObject("WScript.Shell")
objShell.Run strCommand, 0, True

Open in new window


Regards,

Rob.
0
 
LVL 1

Expert Comment

by:expert20
ID: 36550109
0
 
LVL 1

Expert Comment

by:expert20
ID: 36550124
0
 

Author Closing Comment

by:Willing2Learn_More
ID: 36565010
With the VB script and the devcon.exe download from MS I was able to make a package and pushed it out to the systems with success. Thanks!!!..and thanks to all that responded. You guys all rock.
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 36565064
Great.  Thanks for the grade.

Rob.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello again, all.  For those of you that have been following along, you'll know that this is my third article on this topic (though it is not Part III).  This article is sort of remedial, and probably the topic with which I should have started the s…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question