P
P
pcmyonelove2021-06-30 07:15:50
PowerShell
pcmyonelove, 2021-06-30 07:15:50

Starting Ethernet adapter programmatically (using Bath or PowerShell)?

Hello!
I'm looking for a way to programmatically (using Bath or PowerShell) start an ethernet network adapter. In normal mode, when I turn on my computer, it may not be detected in the list of network adapters. In this case, I use a reboot and it helps. This is probably a hardware problem, because this has been observed on various wasps (but this is not certain).
But I would like to be able to do without rebooting every time the interface disappears.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
MaxKozlov, 2021-06-30
@MaxKozlov

Yesoi rescan in the Device manager in the control panel does not find anything, so the software is unlikely to help.
you can search for something in devcon, like
devcon rescan
devcon reset
devcon find(all)
Most likely, he wants to reset the piece of iron.
disable quick boot?

R
Roman Bezrukov, 2021-06-30
@NortheR73

(Get-WmiObject win32_NetworkAdapter -Filter "Index=2").disable()
(Get-WmiObject win32_NetworkAdapter -Filter "Index=2").enable()

R
rPman, 2021-06-30
@rPman

Not powershell, but just a regular netsh
utility , we get a list:

netsh interface show interface

turn off
netsh interface set interface "Network Connection 1" disable

There is also device management and not only wmic :
get a list with an index in the form of a tablet
wmic nic get name, index

turn off device with index 2
wmic path win32_networkadapter where index = 2 call disable

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question