9

How to open setting of the specific network adapter via commandline in Windows 7 Enterprise?
I'm under domain user but also have access to local administator user.
Under domain user I have no rights to do this (to open this settings tab) and want to do this like RUNAS in order to avoid secondary login.
I tried

ncpa.cpl

but this opens list of adapters whereas I want to open settings of specific adapter

4
  • If you say what you want to do in that dialog maybe you could do it with other commands too (like netsh interface ip set address "Local Area Connection" static ipaddr subnetmask gateway metric for instance which you could run with runas)
    – Rik
    Mar 12, 2014 at 11:55
  • Okay, I know about netsh. But open the dialog itself is not possible?
    – Suncatcher
    Mar 12, 2014 at 17:05
  • 1
    Not that i'm aware of. But how about opening ncpa.cpl as another user? Just do runas /user:you_local_admin_user ncpa.cpl. Would that work?
    – Rik
    Mar 12, 2014 at 19:17
  • Mmmm, on one machine i got an error that ncpa.cpl is not a valid Win32 App. However runas /u:you_local_admin_user "cmd /c ncpa.cpl" worked ok. You could make a shortcut or (doskey) alias for that.
    – Rik
    Mar 13, 2014 at 12:45

1 Answer 1

1

PowerShell is your friend.

  1. Start -> Type 'Powershell' -> Right Click -> Run As Administrator
  2. Set-ExecutionPolicy Unrestricted -force
  3. Run the following. The last line here is piping to gm (Get-Member), and that shows you some of what you can do here.
PS C:\WINDOWS\system32> Get-NetAdapter | ?{$_.Name -like 'Ethernet'} | ft -a

Name     InterfaceDescription               ifIndex Status MacAddress        LinkSpeed
----     --------------------               ------- ------ ----------        ---------
Ethernet Realtek PCIe GBE Family Controller      15 Up     D8-CB-8A-66-87-BC    1 Gbps

PS C:\WINDOWS\system32> Get-NetAdapter -InterfaceIndex 15 | ft -a

Name     InterfaceDescription               ifIndex Status MacAddress        LinkSpeed
----     --------------------               ------- ------ ----------        ---------
Ethernet Realtek PCIe GBE Family Controller      15 Up     D8-CB-8A-66-87-BC    1 Gbps

PS C:\WINDOWS\system32> $na = Get-NetAdapter -InterfaceIndex 15
PS C:\WINDOWS\system32> $na | gm
1
  • 1
    Well, it lists adapter properties, but the aim was slightly another one - to view and to edit adapter settings. How can I edit the settings with your approach?
    – Suncatcher
    Apr 11, 2019 at 19:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.