Jump to content

How to disabled a LAN interface using VBS or other script..


johnbreton

Recommended Posts

I need to disabled the WIFI adapter on my new laptop HP NW8240

I know I can do it within Network Connection, but I would like to do it with a script.

I tried Netsh but no luck.

The reason I need to do that is because, Windows XP SP2 takes a long time to load the LAN NIC when logging in.

If I disabled the WIFI card in device manager, the normal LAN kicks in normally.

Thanks for any help

JP

Link to comment
Share on other sites


There's actually no way to do this via WMI, but there is a Win32 class API that can be called to do this. Remember that vbscript can't make API calls, so this needs to be done another way. The other way is via an application that will have access to the API calls, and the best I've found so far is here:

http://channel9.msdn.com/ShowPost.aspx?PostID=158556

Click the "save" link to save the .zip, extract the .dll, .exe, and .config files to their own directory, and you can simply run the command "togglenic <NIC Name> enable" or "togglenic <NIC Name> disable" to enable or disable an interface. Pretty slick.

Note that this is in C#, so .NET is required.

Link to comment
Share on other sites

DEVCON requires you to know information about your hardware, and that will be per-machine specific - the script allows you to disable a NIC by name, which is usually the same on each machine in a corporate environment, immaterial to the actual hardware below.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...