Windows Vista Forums

Enable/Disable Devices using Batch files

  1. #1


    Join Date : Oct 2008
    Posts : 54
    Vista Home Premium 32bit SP2
    Local Time: 08:54 PM

    Enable/Disable Devices using Batch files

    I was wondering if there are any command line switches for devmgmt.msc so that I can write a batch file to enable or disable a certain piece of hardware.

    My problem is whenever I use my Hamachi VPN (emulated as a network card) and leave my computer on afterwords and open up Firefox, I always get 'page not found' whenever I type in an address or go to a bookmark. I then have to open up Device Manager and disable the card and then my internet browser works as usual. Then, whenever I need to use Hamachi again, I just run devmgmt.msc again and enable the card.

    I tried running 'devmgmt /?' in cmd but it just ignores the flag and runs the program. So I was wondering if there any ways to enable/disable devices using any command line program.

    I have a feeling this may also be caused because I have my ethernet connection and my Hamachi VPN set as 'Home' networks.

    Any help is appreciated.

      My System SpecsSystem Spec

  2.   


  3. #2
    archie123's Avatar

    I Tunes hates Me


    Join Date : Jul 2008
    UK
    Posts : 1,831
    Win 7 Home Premium 64bit
    Local Time: 01:54 AM
    uk uk yorkshire

     

    Re: Enable/Disable Devices using Batch files

    you could try disabling its specific service from the command line see if that works

    Using Services.exe from the Command Line

    im sure a little research would give tha answer how to do this via a batch file , i dont think there is a way to disable it via device manager apart from the old fasioned way.....im probably wrong

      My System SpecsSystem Spec

  4. #3



    Newbie
    Join Date : Jul 2009
    Posts : 3
    Vista Home Premium 32bit
    Local Time: 09:54 AM


     

    Re: Enable/Disable Devices using Batch files

      My System SpecsSystem Spec

  5. #4


    Join Date : Oct 2008
    Posts : 54
    Vista Home Premium 32bit SP2
    Local Time: 08:54 PM


      Thread Starter

    Re: Enable/Disable Devices using Batch files

    Thanks a lot for that program. I recall reading about that program before but I never bothered to learn how to use it.

    I did "devcon hwids * > hw.txt" to list all the hardware devices and one I found Hamachi's device ID, I wrote a batch file to enable it by "devcon /r enable hamachi" and disable by "devcon /r disable hamachi".

      My System SpecsSystem Spec


Enable/Disable Devices using Batch files
Similar Threads
Thread Forum
Audio Device - Enable Hidden Devices Tutorials
Enumerate/Enable/Disable Devices VB Script
Defragment Boot Files - Enable or Disable Tutorials
Disable and Enable Devices PowerShell
Select Files - Disable or Enable Full Row Select Tutorials