-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMenu.bat
74 lines (72 loc) · 2.98 KB
/
Menu.bat
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
67
68
69
70
71
72
73
74
::--------------------------------------------------
:: Modifies on : 25-12-2022
:: By Meir.e
:: Menu in batch.
::
::--------------------------------------------------
:: Run once , can run inly in batch file , Global
::--------------------------------------------------
@ECHO OFF & TITLE Mei-R
::--------------------------------------------------
:: Run once , can run inly in batch file , Global
::--------------------------------------------------
:Main
CLS
echo ----------------------------------------------------------------------
echo " @@@@ @@@. #@* @@@@@@@@@@@@ "
echo " @@*@( @&#@. @@@ @@. @@ "
echo " @@ (@. @@ #@. @@ .@@ #@* @@. @@/ "
echo " @@ @@ @@ #@. @@@@@@@@@@@ #@* @@@@@@@@@/ "
echo " @@ @@ (@ #@. @@ #@* @@. *@@. "
echo " @@ @@@, #@. .@@, .@@* #@* @@. &@@ "
echo " /#(. "
echo ----------------------------------------------------------------------
:Menu &REM Menu here
::-------------------------------------------------------------------------------------------
:: Print Menu here
FOR /f "skip=2 tokens=1-2 delims=|" %%a IN ('"findstr /R /C:":OPT" %0"') do (echo ^> %%b)
call :ConsolePrint "test for printing: " & echo.
CALL :ConsolePrint "Type 1, 2, 3, or 4 then press ENTER: " & echo. & CALL :GetChar M &REM Option 2
CALL :OPT%M% &REM replace here the IF %M%==1 GOTO OPT1 ...statements....
::-------------------------------------------------------------------------------------------
GOTO :Main
PAUSE
:: -----------------------------------------------------------------
:: Functions here
:: -----------------------------------------------------------------
::-------------------------------------------------------------------------------------// Color Function
:ConsolePrintColor <hexColorCode> <str>
setlocal
::need run once
for /F "tokens=1,2 delims=#" %%a in ('"prompt #$H#$E# & echo on & for %%m in (1) do rem"') do (set "BS_Char=%%a" ) & echo off &REM Generate the BS Character Method.
call :ConsolePrint %BS_Char% > "%~2" &REM moves BS character
findstr /v /a:%1 /R "^$" "%~2" nul
del "%~2" > nul 2>&1i
endlocal
EXIT /B 0
::-------------------------------------------------------------------------------------
:ConsolePrint <> <>
setlocal
<nul set /p "=%~1"
endlocal
EXIT /B 0
:GetChar <res>
setlocal
:: 0123456789abcdefghijklmnopqrstuvwxyz , can change here what char are available,Mei-R
for /F "tokens=1 delims=," %%a in ('"choice /N /C 0123456789abcdefghijklmnopqrstuvwxyz"') do (set "result=%%a")
endlocal & set result=%result% & set %~1=%result%
EXIT /B 0
:PrintMenu
EXIT /B 0
:OPTW | W - write here something
echo test 123 123 123
pause
EXIT /B 0
:OPTS | S - write here something
echo test 123 123 123
pause
EXIT /B 0
:OPTQ | Q - exit
echo test 123 123 123
exit
EXIT /B 0