Go Back   TechArena Community > Technical Support > Computer Help > Windows Server > Windows Server Help
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read SiteMap

Tags: ,

Sponsored Links


Enable/Disable Network connection at once

Windows Server Help


Reply
 
Thread Tools Search this Thread
  #1  
Old 29-04-2007
Fabio Rosa
 
Posts: n/a
Enable/Disable Network connection at once

Sponsored Links
Hi, in my line of work I have to do a tedious task quite a number of times
every day: enable one network connection and disable the other. What I
actually refer to is that on a laptop - where I have one wired and one
wireless connections - I have to switch between these two connections to
reach a network device I am working on, and from there I may need to reach
the wireless network to get something on the Internet. What I do is a manual
job: open network connections folder, right click one connection, say
"disable", and then double-click the other one. I wonder if someone could
help me out; I'm looking for something like a WSH script on my desktop that
would run this switching task.

Reply With Quote
  #2  
Old 29-04-2007
Dave Patrick
 
Posts: n/a
Re: Enable/Disable Network connection at once

These may help.

http://msdn2.microsoft.com/en-us/library/aa390385.aspx
http://msdn2.microsoft.com/en-us/library/aa390364.aspx
Reply With Quote
  #3  
Old 10-05-2007
Fabio Rosa
 
Posts: n/a
Re: Enable/Disable Network connection at once

Dave,

Thanks for the illustrative answer. I got the point, now it is a question of
developing a script to perform the way I need it. Very helpful of you.
Reply With Quote
  #4  
Old 11-05-2007
Dave Patrick
 
Posts: n/a
Re: Enable/Disable Network connection at once

Good to hear it helps. You're welcome.
Reply With Quote
  #5  
Old 11-05-2007
Oisin Grehan
 
Posts: n/a
Re: Enable/Disable Network connection at once

You might find using the netsh.exe utility a bit easier than getting
tangled up in wmi. I have the same situation at home, and I find
loading netsh scripts easily done with a simple batch file:

1) configure your wifi to be active, then run:

netsh int ip dump > c:\wifi.netsh

2) configure your lan to be active, then run:

netsh int ip dump > c:\lan.netsh

then create two batch files (wifi.bat and lan.bat) to load these
scripts back in:

REM enable wifi
netsh < c:\wifi.netsh

and I'll leave the rest as a ridiculously simple exercise for the
reader ;-)

Hope this helps,

- Oisin
Reply With Quote
  #6  
Old 13-05-2007
Fabio Rosa
 
Posts: n/a
Re: Enable/Disable Network connection at once

Oisin,

Thanks a lot for taking the time. Liked your solution - very elegant.
However, in my case I may need to tweak it a bit: while enabling one
connection, I must disable the other. I will work on it and post the
findings. And I totally agree it is much easier using the netsh.exe rather
than WMI - I was still studying a reasonable solution when saw your post.
Thanks again.

Regards,
Reply With Quote
  #7  
Old 17-02-2009
Member
 
Join Date: Feb 2009
Posts: 16
Re: Enable/Disable Network connection at once

I think this the same problem that i have faced some days ago & i think I got a nice answer for this here!

Powershell Script to Enable/Disable Network Connection

Hope this helps you too!
Reply With Quote
Reply

  TechArena Community > Technical Support > Computer Help > Windows Server > Windows Server Help


Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Enable/Disable Network connection at once"
Thread Thread Starter Forum Replies Last Post
Powershell Script to Enable/Disable Network Connection windows_user Software Development 8 27-04-2012 09:35 PM
How to disable addtional network connection in Windows 7 LavinaD Networking & Security 8 21-09-2011 01:48 PM
Batch file to disable or enable network adapter ToniYap Networking & Security 2 25-06-2010 12:38 AM
Enable connection to network drive at startup envo diverter Networking & Security 5 17-02-2010 07:06 PM
How to enable ICS on a network connection Aanand Technology & Internet 3 29-04-2009 02:19 PM


All times are GMT +5.5. The time now is 02:26 AM.