Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- title Athena Network Monitor
- color 0A
- ::Set your ssid/password here
- set ssid=Athena
- set password=Midgard123
- :: is the wlan compatible?
- if exist "%HOMEDRIVE%%HOMEPATH%\Desktop\drivers.txt" (
- netsh wlan show drivers >%HOMEDRIVE%%HOMEPATH%\Desktop\drivers.txt
- timeout /t 2 >nul
- ) else (
- type NUL >%HOMEDRIVE%%HOMEPATH%\Desktop\drivers.txt
- timeout /t 2 >nul
- netsh wlan show drivers >%HOMEDRIVE%%HOMEPATH%\Desktop\drivers.txt
- )
- for /f "delims=: tokens=2" %%c in ('findstr /c:"Hosted network supported" %HOMEDRIVE%%HOMEPATH%\Desktop\drivers.txt') do set "compatible=%%c"
- if %compatible%=="no" (
- Echo Your Wlan is not compatible with Athena
- del "%HOMEDRIVE%%HOMEPATH%\Desktop\drivers.txt"
- PAUSE
- ) else (
- Echo Starting...
- del "%HOMEDRIVE%%HOMEPATH%\Desktop\drivers.txt"
- )
- :: Beginning of loop
- :top
- :: Detect whether clients.txt exists or not
- if exist "%HOMEDRIVE%%HOMEPATH%\Desktop\clients.txt" (
- netsh wlan show hostednetwork >%HOMEDRIVE%%HOMEPATH%\Desktop\clients.txt
- ) else (
- type NUL >%HOMEDRIVE%%HOMEPATH%\Desktop\clients.txt
- )
- :: assign status to a variable
- for /f "delims=: tokens=2" %%t in ('findstr /c:"Status" %HOMEDRIVE%%HOMEPATH%\Desktop\clients.txt') do set "started=%%t"
- :: assign max clients to a variable
- for /f "delims=: tokens=2" %%m in ('findstr /c:"Max number of clients" %HOMEDRIVE%%HOMEPATH%\Desktop\clients.txt') do set "maxclients=%%m"
- :: assign authentication to a variable
- for /f "delims=: tokens=2" %%l in ('findstr /c:"Authentication" %HOMEDRIVE%%HOMEPATH%\Desktop\clients.txt') do set "authmode=%%l"
- :: Get Sent Bytes
- for /f "tokens=3" %%a in ('netstat -e ^| findstr /i bytes') do set "sent=%%a"
- :: Get Received Bytes
- for /f "tokens=2" %%a in ('netstat -e ^| findstr /i bytes') do set "rec=%%a"
- :: Shorten to KB accuracy to avoid batch math error
- set sentkb=%sent:~0,-3%
- set reckb=%rec:~0,-3%
- :: Do some math
- set /a sentMB = %sentkb% / 1000
- set /a recMB = %reckb% / 1000
- :: Set our client variable
- for /f "delims=" %%a in ('FINDSTR c:"Number of clients" %HOMEDRIVE%%HOMEPATH%\Desktop\clients.txt') do set "clients=%%a"
- :: I'm pretty part
- cls
- Echo ===============================================================================
- Echo Athena Network Monitor
- Echo.
- Echo SSID: %ssid%
- Echo %authmode%: %password%
- Echo Status: %started%
- Echo.
- Echo ===============================================================================
- Echo Bytes Used
- Echo ===============================================================================
- Echo %sentMB% MB Uploaded - %recMB% MB Downloaded
- Echo.
- Echo ===============================================================================
- Echo Clients Connected
- Echo ===============================================================================
- Echo %clients% /%maxclients%
- timeout /t 2 >nul
- if %started%=="Not Started" (
- netsh wlan set hostednetwork mode=allow ssid=%ssid% key=%password% keyUsage=persistent
- timeout /t 2 >nul
- netsh wlan start hostednetwork
- timeout /t 2 >nul
- )
- goto top
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement