netcfg
netcfg is a built-in Windows command (System32\netcfg.exe) that installs, uninstalls and queries network stack components (protocols, services, clients) and shows their bindings to adapters. Its -d switch resets every networking device, so it must never be run casually.
200.1 Why is it used?
- Install or remove a protocol, service or client, e.g. reinstall File and Printer Sharing (MS_Server).
- Check whether a component like MS_TCPIP6 is installed, and dump binding paths for support teams.
- In Windows PE, -winpe brings up basic networking (TCP/IP, NetBIOS, Microsoft Client) during deployment.
- Needs an elevated Command Prompt or PowerShell. Linux/macOS have no direct equivalent (different stack design).
200.2 How it works: components and bindings
- Step 1
1.Client: Client for Microsoft Networks (MS_MSClient, class c)
- Step 2
2.Service: File and Printer Sharing (MS_Server, class s)
- Step 3
3.Client opens a file share; request goes down to the protocol
- Step 4
4.Protocol: TCP/IP (MS_TCPIP, class p)
- Step 5
5.Leaves through the Ethernet adapter (NIC)
- Step 6
6.Bindings = which component runs on top of which adapter; netcfg manages these
| Class letter | Component type | Example ID |
|---|---|---|
| p | Protocol | MS_TCPIP, MS_TCPIP6 |
| s | Service | MS_Server (File and Printer Sharing) |
| c | Client | MS_MSClient (Client for Microsoft Networks) |
200.3 Install components
- On the office PC only netcfg -? was run: it prints help and changes nothing.
C:\Windows\System32\netcfg.exe -? -c provides the class of the component to be installed (p == Protocol, s == Service, c == Client) -i provides the component ID The arguments must be passed in the order shown.netcfg -l c:\oemdir\myprot.inf -c p -i myprotnetcfg -c s -i MS_Servernetcfg -v -winpe| Option | Meaning |
|---|---|
| -l <path.inf> | full path of the INF file |
| -c p|s|c | class: protocol, service, client |
| -i <comp-id> | component ID to install |
| -winpe | WinPE: install TCP/IP, NetBIOS and Client together |
| -e | use servicing environment variables |
| order | fixed: -l, then -c, then -i |
200.4 Query, uninstall and show
netcfg /q MS_IPXnetcfg /u MS_IPXnetcfg /s nnetcfg /b ms_tcpipnetcfg -v -mnetcfg [-v] -b <comp-id> netcfg -b ms_tcpip Shows binding paths containing 'MS_TCPIP'netcfg [-v] -m Outputs the binding map to NetworkBindingMap.txt in the current directory. -v will also display the binding map to the console.| Switch | Effect | Risk |
|---|---|---|
| -q <comp-id> | is it installed? | safe, read only |
| -s a / -s n | installed adapters / all net components | read only, but lists VPN, antivirus, filter driver names |
| -b <comp-id> | binding paths of a component | read only |
| -m (-v -m) | binding map to NetworkBindingMap.txt (and console) | writes a file |
| -u <comp-id> | uninstall the component | riskiest: wrong component breaks the network |
- Query/show switches were not run on the office PC (they reveal installed security/VPN software); the commands shown are Microsoft Learn examples.
200.5 Cleanup / reset: -d and -x
netcfg -d Performs a cleanup on all networking devices. This will require a reboot.netcfg -x netcfg -x Performs a cleanup on networking devices, skipping those without physical object names. This will require a reboot.- Step 1
1.Run netcfg -d on a Windows PC
- Step 2
2.Cleanup on all networking devices: Ethernet, Wi-Fi, VPN adapters removed and reset
- Step 3
3.Static IPs, VPN adapters and saved settings are lost
- Step 4
4.Reboot required
- Step 5
5.Adapters are detected again only after reboot; reconfigure static IP and VPN
-x does the same but skips devices without a physical object name. Settings > Network reset is similar.
200.6 General options
- -v: verbose output with any command.
- -?: help (the only switch run in the video).
- Microsoft Learn writes switches as /q, /u, /s; netcfg accepts both dash and slash forms.
200.7 When to use which
| Goal | Use | Avoid |
|---|---|---|
| Is IPv6 installed? | netcfg -q MS_TCPIP6 | netcfg -d |
| Support needs bindings | netcfg -v -m | -u guesses |
| Reinstall file sharing | netcfg -c s -i MS_Server (test machine first) | -d |
| Network totally broken, nothing else works | note static IP/VPN config, then netcfg -d + reboot | running it remotely (cuts your own session) |
200.8 Common mistakes
- Using netcfg -d as a quick fix for a slow network: diagnose with ipconfig and ping first; reset is a last resort.
- Running -d on a remote server: it cuts your own connection.
- Not noting static IP and VPN settings before a reset.
- Passing -l/-c/-i out of order.
- Uninstalling the wrong component with -u.
200.9 Interview tips
- netcfg installs, queries and uninstalls network components (protocol, service, client) and shows bindings.
- Install order is fixed: -l INF, -c class (p/s/c), -i ID.
- -q only reports; -u removes; -b/-m show bindings.
- -d resets all networking devices and needs a reboot: last resort only.
- -winpe brings up networking in Windows PE deployments.