Solved

VB Script to disable a device in device manager XP

Posted on 2011-09-15
5
360 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: 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

This is an addendum to the following article: Acitve Directory based Outlook Signature (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_24950055.html) The script is fine, and works in normal client-server domains…
Welcome, welcome!  If you are new to the series and haven't been following along, please take a brief moment to review the first three installments: Part 1 (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/A_266-VBScri…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

724 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