Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 386
  • Last Modified:

VB Script to disable a device in device manager XP

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
Willing2Learn_More
Asked:
Willing2Learn_More
  • 2
  • 2
1 Solution
 
RobSampsonCommented:
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
 
expert20Commented:
0
 
Willing2Learn_MoreAuthor Commented:
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
 
RobSampsonCommented:
Great.  Thanks for the grade.

Rob.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now