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 Newsgroups > Vista General

Vista - Enable/Disable NIC from command line?

Reply
 
Old 09-20-2007   #1 (permalink)
harryajh


 
 

Enable/Disable NIC from command line?

I quite often just shut my laptop lid for a few hours and when
reopening it the NIC I was using to access the Internet is disabled!

Rather than re-enable via control panel etc... can I do it from the
command prompt e.g something like net start "Realtek RTL8139/810x
Family Fast Ethernet NIC"

I'm aware of the option to prevent vista disabling the device when in
sleep mode but want to try changing this setting if possible!

can it be done?

thanks

harry


My System SpecsSystem Spec
Old 09-20-2007   #2 (permalink)
Andrew McLaren


 
 

Re: Enable/Disable NIC from command line?

"harryajh" <harryajh@xxxxxx> wrote ...
Quote:

> Rather than re-enable via control panel etc... can I do it from the
> command prompt e.g something like net start "Realtek RTL8139/810x
> Family Fast Ethernet NIC"
Hi Harry

My first thought was that some variety of the "netsh" command, should do
this. But I can't work out the correct syntax (if any).

An alternative which will certainly work, but would require some small
effort on your part to set up, is to use the WMI Win32_NetworkAdapter Class
class. This class has an Enable method, which you could call in a short
VBScript. You'll find a sample scrip to enable an adapter, in the MSDN doco
for the method:

http://msdn2.microsoft.com/en-us/library/aa390385.aspx class.

Put the script in a file with a *.vbs extension, then run it at a command
prompt by typing the file name.

There may be other ways as well, but this should definitely work. Note that
you may need to open a command prompt "As Administrator" for this to work.

Hope it helps.

--
Andrew McLaren
amclar (at) optusnet dot com dot au


My System SpecsSystem Spec
Old 09-20-2007   #3 (permalink)
Paul Randall


 
 

Re: Enable/Disable NIC from command line?


"Andrew McLaren" <andrew@xxxxxx> wrote in message
news:326822EE-2FBB-44C9-A802-8768BB9A723E@xxxxxx
Quote:

> "harryajh" <harryajh@xxxxxx> wrote ...
Quote:

>> Rather than re-enable via control panel etc... can I do it from the
>> command prompt e.g something like net start "Realtek RTL8139/810x
>> Family Fast Ethernet NIC"
>
> Hi Harry
>
> My first thought was that some variety of the "netsh" command, should do
> this. But I can't work out the correct syntax (if any).
>
> An alternative which will certainly work, but would require some small
> effort on your part to set up, is to use the WMI Win32_NetworkAdapter
> Class class. This class has an Enable method, which you could call in a
> short VBScript. You'll find a sample scrip to enable an adapter, in the
> MSDN doco for the method:
>
> http://msdn2.microsoft.com/en-us/library/aa390385.aspx class.
>
> Put the script in a file with a *.vbs extension, then run it at a command
> prompt by typing the file name.
>
> There may be other ways as well, but this should definitely work. Note
> that you may need to open a command prompt "As Administrator" for this to
> work.
>
> Hope it helps.
>
> --
> Andrew McLaren
> amclar (at) optusnet dot com dot au
Posting to the newsgroup at microsoft.public.scripting.vbscript might lead
to such a script.

-Paul Randall


My System SpecsSystem Spec
Old 09-20-2007   #4 (permalink)
harryajh


 
 

Re: Enable/Disable NIC from command line?

On 20 Sep, 13:41, "Andrew McLaren" <and...@xxxxxx> wrote:
Quote:

> "harryajh" <harry...@xxxxxx> wrote ...
>
Quote:

> > Rather than re-enable via control panel etc... can I do it from the
> > command prompt e.g something like net start "Realtek RTL8139/810x
> > Family Fast Ethernet NIC"
>
> Hi Harry
>
> My first thought was that some variety of the "netsh" command, should do
> this. But I can't work out the correct syntax (if any).
>
> An alternative which will certainly work, but would require some small
> effort on your part to set up, is to use the WMI Win32_NetworkAdapter Class
> class. This class has an Enable method, which you could call in a short
> VBScript. You'll find a sample scrip to enable an adapter, in the MSDN doco
> for the method:
>
> http://msdn2.microsoft.com/en-us/lib...0385.aspxclass.
>
> Put the script in a file with a *.vbs extension, then run it at a command
> prompt by typing the file name.
>
> There may be other ways as well, but this should definitely work. Note that
> you may need to open a command prompt "As Administrator" for this to work.
>
> Hope it helps.
>
> --
> Andrew McLaren
> amclar (at) optusnet dot com dot au
many thanks for that andrew, will give it a go later & post back what
happens!

My System SpecsSystem Spec
Old 09-20-2007   #5 (permalink)
Adam Leinss


 
 

Re: Enable/Disable NIC from command line?

harryajh <harryajh@xxxxxx> wrote in news:1190275750.442526.162700
@d55g2000hsg.googlegroups.com:
Quote:

> I quite often just shut my laptop lid for a few hours and when
> reopening it the NIC I was using to access the Internet is disabled!
>
> Rather than re-enable via control panel etc... can I do it from the
> command prompt e.g something like net start "Realtek RTL8139/810x
> Family Fast Ethernet NIC"
You can do it with devcon, try Googling "devcon"

Adam
--
Visit my PC Tech blog at www.leinss.com/blog
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Command Prompt - Enable or Disable Tutorials
Running a command from inside a script, command line is corrupted PowerShell
how to enable the line-in jack Vista General
What is the command line command for unzipping files? Vista General
Command Line Ren (Rename) command broken? Vista General


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