Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista General Discussion > Enable/Disable NIC from command line?

Reply
Thread Tools Display Modes

Enable/Disable NIC from command line?

 
 
harryajh
Guest
Posts: n/a

 
      09-20-2007
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

 
Reply With Quote
 
 
 
 
Andrew McLaren
Guest
Posts: n/a

 
      09-20-2007
"harryajh" <> wrote ...
> 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


 
Reply With Quote
 
Paul Randall
Guest
Posts: n/a

 
      09-20-2007

"Andrew McLaren" <> wrote in message
news:326822EE-2FBB-44C9-A802-...
> "harryajh" <> wrote ...
>> 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


 
Reply With Quote
 
harryajh
Guest
Posts: n/a

 
      09-20-2007
On 20 Sep, 13:41, "Andrew McLaren" <and...@fakeaddress.com> wrote:
> "harryajh" <harry...@yahoo.co.uk> wrote ...
>
> > 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!

 
Reply With Quote
 
Adam Leinss
Guest
Posts: n/a

 
      09-20-2007
harryajh <> wrote in news:1190275750.442526.162700
@d55g2000hsg.googlegroups.com:

> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Command line boot from CD/DVD rodeworrier Windows Vista Performance 1 01-13-2008 06:41 PM
XP command line Qfreed Windows Vista Networking 2 08-25-2007 02:31 PM
Where is the help for command line commands? Peter Flindt Windows Vista General Discussion 6 07-24-2007 01:51 PM
line in disabled..will not enable beardo Windows Vista Hardware 3 05-21-2007 07:06 PM
Vista Command Line rshol Windows Vista File Management 3 02-27-2007 08:32 PM



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 47 48 49 50 51 52 53 54 55 56 57 58 59