Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Vista Forums > Drivers

Vista - Enable/Disable Devices using Batch files

Reply
 
Old 08-27-2009   #1 (permalink)


Vista Home Premium 32bit SP2
 
 

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
Old 08-27-2009   #2 (permalink)


Vista Home Premium 64bit SP2
 
 

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
Old 08-28-2009   #3 (permalink)


Vista Home Premium 32bit
 
 

Re: Enable/Disable Devices using Batch files

My System SpecsSystem Spec
Old 08-30-2009   #4 (permalink)


Vista Home Premium 32bit SP2
 
 

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
Reply

Thread Tools


Similar Threads
Thread Forum
DEP - Enable or Disable Tutorials
Audio Device - Enable Hidden Devices Tutorials
Defragment Boot Files - Enable or Disable Tutorials
Disable and Enable Devices PowerShell
Select Files - Disable or Enable Full Row Select Tutorials


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46