How enable network adapter in script?

B

Bill

On Windows XP Pro SP2 I need to enable or disable a network adapter
using netsh.exe but the command:

netsh interface set interface name="Wired LAN" admin=ENABLED

fails with the message "One or more essential parameters not specified".

What is the correct syntax? I have had no luck finding an example using
Google. Note that I know the name of the interface is correct because I
can change the adapter from DHCP to a static IP address and back using
netsh.exe.

Thanks.
 
B

Bill

I have done that and the command I posted matches the help display
exactly as I interpret it.
 
P

Pavel A.

Netsh does not seem to support enabling LAN interfaces.
You can try the "devcon" utility to enable/disable the physical net adapter.

Regards,
--PA
 
B

Bob I

Looking up the term Netsh commands in Windows "Help and Support" and
picking "Netsh commands for Routing" and then "set interface" gets more
info and an example.
 
B

Bill

Thanks. Help & Support is usually so completely worthless that I never
considered looking there. Unfortunately, the information in Help &
Support does not show a way to enable or disable the adapter.
 
B

Bill

Pavel said:
Netsh does not seem to support enabling LAN interfaces.
You can try the "devcon" utility to enable/disable the physical net
adapter.

I tried devcon. It worked perfectly with the ethernet adapter. When I
tried it with my wireless adapter it disabled about 12 devices
including the external mouse. Fortunately rebooting to the last good
configuration saved me. Devcon is clearly too dangerous for me. I'll
disable and enable the adapters manually in device manager.
 
P

Pavel A.

Bill said:
I tried devcon. It worked perfectly with the ethernet adapter. When I
tried it with my wireless adapter it disabled about 12 devices
including the external mouse. Fortunately rebooting to the last good
configuration saved me. Devcon is clearly too dangerous for me. I'll
disable and enable the adapters manually in device manager.

?? perhaps you gave it a wrong device id (like USB\* :)
Devcon is very well tested and just should work as documented.
If you have troubles with it, please ask in microsoft.public.development.device.drivers

--PA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top