1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Enabling/Disabling Hardware in Win2000 with Visual Basic?

Discussion in 'Software Development' started by Talismanic, May 24, 2001.

Thread Status:
Not open for further replies.
Advertisement
  1. Talismanic

    Talismanic Thread Starter

    Joined:
    May 25, 2000
    Messages:
    409
    Can some one help me get started with this project? I need to make a program that will run in the System tray that can enable or disable hardware, actualy just one particular piece of hardware. I am only dealing with Windows 2000 here so I don't have to worry about multiple operating systems.

    I think I can get the system tray part figured out from various VB tutorials but I don't know where to begin when dealing with the hardware. Any ideas?
     
  2. Talismanic

    Talismanic Thread Starter

    Joined:
    May 25, 2000
    Messages:
    409
    Some one from another board showed me this solution using the Send Keys and it works great.

    Set WshShell = CreateObject("WScript.Shell")
    WshShell.Run "devmgmt.msc"
    While WshShell.AppActivate("Device Manager") = False
    Wend
    WshShell.AppActivate "Device Manager"
    WshShell.SendKeys "{Tab}"
    WshShell.SendKeys "Ports"
    WshShell.SendKeys "{Right}"
    WshShell.SendKeys "{Down}"
    WshShell.SendKeys "{Down}"
    WshShell.SendKeys "+{F10}"
    WshShell.SendKeys "D"
    WshShell.SendKeys "%Y"
    WshShell.SendKeys "%{F4}"

    [Edited by Talismanic on 05-30-2001 at 03:16 PM]
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/44598