# iwconf-win
A colorful, `iwconfig`-flavored WLAN control tool for Windows — backed
directly by the native WLAN API (`wlanapi.dll`), with **no `netsh`
subprocess anywhere in the connect/scan/status path**.
```
$ iwconf
📶 Wi-Fi
Description Intel(R) Dual Band Wireless-AC 8265
State 🟢 connected
SSID 🔒 TUYUL
BSSID 5e:19:d5:06:35:d5
Network type Infrastructure
Radio type 802.11n
Authentication WPA2-Personal
Cipher CCMP (AES)
Connection mode Auto Connect
Channel 10 (2.4 GHz)
Link rate rx 65 Mbps / tx 65 Mbps
Signal ████████░░ 81%
Profile TUYUL
```
## Why no `netsh`?
`netsh wlan show interface` is a subprocess call, a text-parsing
problem, and a locale-dependent one (its column labels are translated
per Windows display language, which breaks naive parsers on non-English
systems). `iwconf` talks to `wlanapi.dll` directly via the `windows`
crate, so it's faster, robust to locale, and can be started before/after
elevation without shelling out.
## Install
```powershell
cargo install iwconf-win
```
Or grab a prebuilt `iwconf.exe` from the
[Releases page](https://github.com/cumulus13/iwconf-win/releases).
## Usage
```text
iwconf # show every wireless interface + connection
iwconf -i Wi-Fi # show one interface, exact name
iwconf -i "Wi-Fi*" # wildcard match (errors + lists matches if ambiguous)
iwconf -i "wlan\d+" --regex # true regex match
iwconf --scan # list visible networks (cached scan)
iwconf --scan --rescan # force a fresh scan first
iwconf -i Wi-Fi --scan # scan on one specific interface
iwconf --essid MyNetwork --key "hunter2" # connect (secured)
iwconf --essid OpenCafeWifi # connect (open network)
iwconf --essid Home --profile "Home" # connect via an existing saved profile
iwconf -d # disconnect
iwconf --json # machine-readable output for scripting
iwconf --no-color --no-emoji # or --plain for both at once
```
Connecting to a *new* secured network requires creating a Windows WLAN
profile, which requires the process to be **elevated** (same as
`netsh wlan add profile`) — run from an admin prompt if `--essid --key`
fails with an access-denied style error. Reading status and scanning
never require elevation.
## Configuration
`iwconf` will pick up a config file (TOML by default) if you create
one — none is required. Location follows the platform config-dir
convention via [`config-get`], e.g.
`%APPDATA%\iwconf\iwconf\config.toml`:
```toml
[iwconf]
default_iface = "Wi-Fi"
no_color = false
no_emoji = false
connect_timeout = 15
```
## Built on
- [`config-get`](https://crates.io/crates/config-get) — cross-platform config discovery
- [`make_colors`](https://crates.io/crates/make_colors) — hex-color terminal output
- [`clap-version-flag`](https://crates.io/crates/clap-version-flag) — colorful `--version`
- [`clap-color-help`](https://crates.io/crates/clap-color-help) — colorful `--help`
- [`windows`](https://crates.io/crates/windows) — the native WLAN API bindings
## License
MIT OR Apache-2.0
## 👤 Author
[Hadi Cahyadi](mailto:cumulus13@gmail.com)
[](https://www.buymeacoffee.com/cumulus13)
[](https://ko-fi.com/cumulus13)
[Support me on Patreon](https://www.patreon.com/cumulus13)