如何在Windows 10中直接打开IPV4属性?

问题描述 投票:0回答:1

我想直接打开这种类型的窗口:

enter image description here

你怎么做?

Powershell?捷径?我进行了一些研究,但没有找到任何东西,对于“ ncpa.cpl”我知道,但是它是多面手,我想要一个特定的nic。

windows powershell windows-10 shortcut windows-networking
1个回答
0
投票

这应该可以解决问题(PowerShell):

Add-Type -AssemblyName System.Collections

[System.Collections.Generic.List[string]]$ncs = @()
[System.Collections.Generic.List[object]]$ncreg = @()

$networkcards = reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards"
$networkcards = @($networkcards | ? { $_ })

[void]$ncreg.AddRange( $networkcards ) 

foreach( $nc in $ncreg ) {

    $id = reg query $nc
    [void]$ncs.Add( $id )
}

foreach( $nc in $ncs ) {

    if( $nc -match '^.*{.*}' ) {
        $ncIdent = $nc -replace '^.*({.*}).*', '$1'
        start "::{208D2C60-3AEA-1069-A2D7-08002B30309D}\::{7007ACC7-3202-11D1-AAD2-00805FC1270E}\::$ncIdent"
        [System.Windows.Forms.SendKeys]::SendWait('{Tab}{ENTER}')
    }

}
© www.soinside.com 2019 - 2024. All rights reserved.