Disable Local Area Connection from Command line


Recommended Posts

Hello Everyone,

I want to disable and enable my network connection using a script.

On my XP I had an icon that did a:

netshx Disable "Local Area Connection"

This still works on my new Windows 7 but now the UAC pops up when I run the icon.

When I disable/enable the network card from Device Manager the UAC don't pop up.

I've tried:

netsh interface set interface "Local Area Connection" DISABLE

But received this error:

An interface with this name is not registered with the router.

So, is there a command line to disable the network card without the UAC popping up?

Acakuo

netshx is not a windows builtin command -- its a script someone put together that uses devcon to control hardware

http://www.novell.com/communities/node/233...nd-line-control

run your netshx command from an elevated command prompt.

You use to only be able to enable disable wireless, but from a elevated prompt this command works on 7 for wired interfaces.

Netsh interface set interface "Local Area Connection" enable

Netsh interface set interface "Local Area Connection" disable

Or whatever you have your interface called.

"An interface with this name is not registered with the router."

You get that error because you ran it from a non admin prompt. You need to run such a command from an elevated command prompt.

post-14624-1258985812_thumb.png

Edited by BudMan

Thanks allot,

The netshx does work when I use the CMD as administrator. But I'm back with the UAC windows?

It looks like I will use the "IPCONFIG /RELEASE" and "/RENEW" this does the trick of disabling the network connection without the UAC popping up.

With this method I don?t get any visual icon to see that the net is disconnected, but it's seems to be the best that I can get on 7.

Acakuo

using the actual netsh command does not pop up a UAC prompt. and disables the interface.. Like I said netshx is not a command -- its a script that uses devcon.

  BudMan said:
using the actual netsh command does not pop up a UAC prompt. and disables the interface.. Like I said netshx is not a command -- its a script that uses devcon.

sorry I meant netsh in my replay...

How can you use the netsh with out the UAC prompt?

I've made a bat file with the line "Netsh interface set interface "Local Area Connection" disable" in it.

1. normal run will no nothing.

2. right click -> run as admin will pop the UAC and then disable the network.

3. the properties -> compatibility is grayed out, so i used This but still it does nothing.

What am i missing?

Acakuo

Like I said run from an admin prompt -- and you get no popup.

post-14624-1259016356_thumb.png

You get the prompt when you you run the console as admin -- but once your in as admin running the command does not pop it up again.

So now your question is how to run a batch file as admin without a UAC prompt -- hmmmm, off the top of my head not sure how to do that - would have to look it up.. Not something you should be doing normally.

Here you go this should work for you

http://www.winhelponline.com/blog/run-prog...the-uac-prompt/

How to Run Programs Elevated Without Getting the UAC Prompt

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • >Fixed: Certain displays might be unexpectedly green. I believe that this fixed the Windows mishandling Dolby Vision issue in RGB 12 bit Full mode we saw recently.
    • These SSDs from Crucial, SanDisk, and Western Digital are selling at great prices by Fiza Ali Amazon US is currently offering a wide range of solid‑state drives at attractive prices, covering both internal and portable options to meet diverse storage needs. So, whether you're looking to expand your laptop's storage, speed up your desktop, or carry large files on the move, these discounts make it easier to secure reliable SSD technology without exceeding your budget. The 1TB Crucial BX500 is a 2.5‑inch SATA III solid‑state drive offering a maximum interface speed of 6Gb/s. In terms of performance, the drive achieves sequential read speeds of up to 540MB/s and sequential write speeds of up to 500MB/s. It is rated for an endurance of 360TB total bytes written (TBW). 1TB Crucial BX500 Internal SSD: $56.99 (Amazon US) - 40% off The 2TB Crucial P3 Plus is an NVMe SSD in the M.2 2280 form factor, utilising a PCIe Gen 4 ×4 interface. It delivers sequential read speeds of up to 5,000MB/s and sequential write speeds of up to 4,200MB/s. Rated for 440TBW, it offers durable performance for everyday and professional use alike. 2TB Crucial P3 Plus NVMe SSD: $113.99 (Amazon US) The 4TB Crucial X10 portable SSD features a USB 3.2 Gen 2x2 interface, supporting data transfer speeds of up to 20Gb/s. The drive delivers sequential read speeds of up to 2,100MB/s, making it suitable for tasks such as video editing, file transfers, and system backups. 4TB Crucial X10 Portable SSD: $246.99 (Amazon US) - 38% off The 2TB SanDisk Extreme Portable SSD comes equipped with a USB 3.2 Gen 2 interface (backwards compatible with USB 3.0 and USB 2.0). It delivers sequential read speeds of up to 1 000 MB/s, promising rapid file transfers and game loading times. Designed, tested, and approved for use with PlayStation 5 consoles, this rugged SSD lets you archive and restore game libraries rapidly. It is IP55‑rated for water and dust resistance as well. 2TB SanDisk Extreme Portable SSD: $178.01 (Amazon US) - 26% off The 1TB Western Digital Blue SA510 SSD connects via SATA III (6Gb/s). It delivers sequential read speeds of up to 560MB/s and write speeds up to 520MB/s, with random performance rated at 90,000 IOPS for reads and 82,000 IOPS for writes. Built on WD’s 3D NAND technology, it carries a 400TBW endurance rating and is backed by a five‑year limited warranty. Finally, it operates safely between 0°C and 70°C (–55°C to 85°C when powered down). 1TB Western Digital WD Blue SA510 Internal SSD: $63.17 (Amazon US) - 26% off This Amazon deal is US-specific and not available in other regions unless specified. If you don't like it or want to look at more options, check out the Amazon US deals page here. Get Prime (SNAP), Prime Video, Audible Plus or Kindle / Music Unlimited. Free for 30 days. You can also check out other SSD deals here. For hard disk drives, you can head over to our HDD deals section to see if anything from there matches your requirements. Make sure you also browse through Amazon US, Amazon UK, and Newegg US to find some other great tech deals. As an Amazon Associate, we earn from qualifying purchases.
    • Look at the fingers especially round the cups, you’d think A needs to add the I together
    • There are too many people doing nothing and just cruising at MS because of how the previous culture was (rest and vest).
  • Recent Achievements

    • Week One Done
      Wayne Robinson earned a badge
      Week One Done
    • One Month Later
      Karan Khanna earned a badge
      One Month Later
    • Week One Done
      Karan Khanna earned a badge
      Week One Done
    • First Post
      MikeK13 earned a badge
      First Post
    • Week One Done
      OHI Accounting earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      681
    2. 2
      ATLien_0
      275
    3. 3
      Michael Scrip
      207
    4. 4
      +FloatingFatMan
      172
    5. 5
      Steven P.
      143
  • Tell a friend

    Love Neowin? Tell a friend!