forked from Klozz/CMD-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wifiGraphic.cmd
66 lines (66 loc) · 2.49 KB
/
wifiGraphic.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
:: BEGIN SCRIPT :::::::::::::::::::::::::::::::::::::::::::::::::::::
:: wifiGraphic.cmd
:: From the desk of Frank P. Westlake, 2013-06-01
:: A single bar graph of the connected WIFI signal strength.
:: Written on Windows 8.
:: If you have a hex editor set mark character to hex DB.
@Echo OFF
@SetLocal EnableExtensions EnableDelayedExpansion
:User_Configuration ****************************************************
REM These values may be changed while the script is active.
Set "mark=Û" % REM Set this to your desired graphic. %
Set "delay=1" % REM Delay in seconds between updates. %
Set "low=20" % REM Zero to "low" is the low range. %
Set "mid=50" % REM "low" to "mid" is the mid range. %
% REM "mid" to 100 is the high range. %
Set "lowColor=0C" % REM Color for low range. %
Set "midColor=0E" % REM Color for moderate range. %
Set "highColor=0A" % REM Color for high range. %
REM END USER CONFIGURATION ********************************************
Set "codePage=437" % REM Code page. %
REM Continue if just starting, go to :EOF if being CALLed.
If "%0" EQU ":User_Configuration" Goto :EOF
If "%*" NEQ "/start" (
START "WIFI" CMD /c%~f0 /start
Exit
Goto :EOF
)
MODE CON lines=1 cols=107
CHCP %codePage% >NUL:
Set "bar="
Set "sp="
For /L %%i in (1,1,100) Do (
Set "bar=!bar!!mark!"
Set "sp=!sp! "
)
Set /A "delay*=1000"
Set "SLEEP=PING 127.255.255.255 -n 1 -w !delay! >NUL:"
:: Get a carriage return character.
For /F %%a in ('COPY /Z "%~dpf0" NUL:') Do Set "CR=%%a"
For /L %%i in (1,0,2) Do (
For /F "tokens=1 delims==" %%a in ('Set "$" 2^>NUL:') Do Set "%%a="
Set "$Signal=0%%" & Set "color=!lowColor!"
For /F "tokens=1,2 delims=:" %%a in ('netSh wlan show interfaces') Do (
Set "#=%%a" & Set "#=!#: =!"
Set "$=%%b" & Set "$=!$:~1!" & Set "$!#!=!$!"
If DEFINED $Profile (
If /I "!$State!" EQU "connected" (
Set "load=!$Signal! "
)
Set "$Profile="
)
)
For /L %%s in (!$Signal! 1 !$Signal!) Do (
Title WIFI %%s%%
If %%s LEQ !low! ( Set "COLOR=!lowColor!"
) Else If %%s LEQ !mid! ( Set "COLOR=!midColor!"
) Else ( Set "COLOR=!highColor!"
)
Set /P "=!load:~0,4! !bar:~0,%%s!!sp:~%%s! !CR!"<NUL:
COLOR !color!
)
%SLEEP%
Call :User_Configuration
)
Goto :EOF
:: END SCRIPT ::::::::::::::::::::::::::::::::::::::::::::::::::::