Skip to content

Instantly share code, notes, and snippets.

@arieljannai
Last active January 31, 2016 13:37
Show Gist options
  • Save arieljannai/ff5c1bf26483f4179920 to your computer and use it in GitHub Desktop.
Save arieljannai/ff5c1bf26483f4179920 to your computer and use it in GitHub Desktop.
Set the WiFi interface on or off
@rem save the script wherever you'd like to
@rem create a shortcut named "wifi" and put it in a place that's in your path (shortcuts folder, system32, whatever..)
@rem set the shortcut to run as administrator! IMPORTANT!
@rem run "wifi on" or "wifi off" and enjoy your life.
@rem the default wifi interface name is "Wireless Network Connection" just cause that's the way it's on my computer.
@rem you can run "wifi-set-on-off.bat" script without any parameters to see what's your wifi interface name (I've added "Wi" filter assuming it will be WiFi or wireles..)
@ECHO OFF
if "%1"=="on" goto yes
if "%1"=="off" goto no
:show
netsh interface show interface | find "Wi"
pause
goto done
:yes
netsh interface set interface "Wireless Network Connection" enabled
goto done
:no
netsh interface set interface "Wireless Network Connection" disabled
goto done
:done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment