Skip to content

Commit 81565a6

Browse files
committed
Update AutoRunWithCMD.cmd
Add a true debug menu, many more things, and a (mostly) broken font color switcher, no CLUE why it doesn't work.
1 parent edae4ac commit 81565a6

File tree

1 file changed

+102
-3
lines changed

1 file changed

+102
-3
lines changed

AutoRunWithCMD.cmd

Lines changed: 102 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
:: Sets the color, disables command feedback, and clears the screen of the version and whatnot text.
22
@echo off
33
cls
4-
color 0a
54
cd %appdata%
65
:: Debug stuff, making a place for logs
76
if exist "Sanikdah Software" (
@@ -85,9 +84,9 @@ goto :MainMenu
8584

8685
:: Main menu code, sets the title, adds 2 blank lines, and eventually a working choice system.
8786
:MainMenu
87+
@echo off
8888
title Welcome! What would you like to do?
8989
echo.
90-
echo.
9190
echo This is a placeholder menu until I design a real one!
9291
goto :Choice
9392
echo.>MainMenuTriggered.txt
@@ -100,25 +99,46 @@ echo.
10099
echo. 1: Go to the regular command line and run your own commands!
101100
echo. 2: Test your internet connection by pinging Google!
102101
echo. 3: Repair your system by running DISM and System File Checker!
102+
echo. 4: Get your public IP!
103+
echo. 5: Check network statistics!
104+
echo. 8: Settings
103105
echo. 9: Access Help
104106
set /p choice= Your choice?=
105107
if not '%choice%'=='' set choice=%choice:~0,1%
106108
if '%choice%'=='1' goto :GoToRegularCMD
107109
if '%choice%'=='2' goto :PingGoogle
108110
if '%choice%'=='3' goto :DISMandSFC
111+
if '%choice%'=='4' goto :CurlIPme
112+
if '%choice%'=='5= goto :CheckNetworkStatistics
109113
if '%choice%'=='exit' goto :exit
110114
if '%choice%'=='leave' goto :exit
111115
if '%choice%'=='die' goto :exit
112116
if '%choice%'=='debug' goto :debug
117+
if '%choice%'=='8' goto :Settings
113118
if '%choice%'=='9' goto :Help
114119
ECHO "%choice%" is not a valid option, please try again.
115120
ECHO.
116121
goto :Choice
117122
echo.>EndOfChoiceTriggered.txt
118123

119124

125+
:CurlIPme
126+
@echo off
127+
title Please Wait....
128+
echo Getting your IP....
129+
curl ip.me > TempIP.txt
130+
set /p IP= < TempIP.txt
131+
del TempIP.txt
132+
echo Your public IP is %IP%
133+
set %IP%=
134+
goto :MainMenu
135+
136+
:CheckNetworkStatistics
137+
138+
120139
:GoToRegularCMD
121140
@echo off
141+
title Command Prompt
122142
goto :leave
123143
echo.>EndOfGoToRegualarCMDTriggered.txt
124144

@@ -138,6 +158,7 @@ echo.>EndOfPingGoogleTriggered.txt
138158
:debug
139159
@echo off
140160
cls
161+
title WARNING
141162
echo.====WARNING========WARNING=======WARNING=====
142163
echo.====WARNING========WARNING=======WARNING=====
143164
echo.====WARNING========WARNING=======WARNING=====
@@ -157,7 +178,85 @@ echo No debug 4 u
157178
ping techflash.ga -n 1 > nul
158179
goto :noDebug
159180

160-
:: Debug options don't exist as it would be accessible even if you didn't aggree to the terms.
181+
:realDebug
182+
echo Nothing here yet, currently working on the menu.
183+
goto :MainMenu
184+
185+
:useBetterGrammarDebug
186+
echo Use better grammar next time, CAPITALIZE >:(
187+
goto :realDebug
188+
189+
:: Settings menu
190+
:Settings
191+
@echo off
192+
cls
193+
echo.Welcome to the settings menu! Here you can modify some settings!
194+
echo.1: Modify the default color when you start the script.
195+
echo.2: Not yet created just felt like adding this here. :P
196+
set /p SettingsChoice=
197+
if '%SettingsChoice%'=='1' goto :color
198+
if '%isSureOfDebugOptions%'=='2' goto :Nothing
199+
200+
:: A label used for when I wanted to add an option but it isn't implemented yet or is in a state where it can't be used.
201+
:Nothing
202+
@echo off
203+
echo Nothing here yet! There might be soon O_O
204+
echo. Going back to settings in 5 seconds.
205+
timeout 5
206+
goto :Settings
207+
208+
:: A basic section of code for setting the default color of the shell.
209+
:color
210+
@echo off
211+
echo.Welcome to the color selection menu!
212+
echo.Please enter a Command Prompt-format color code.
213+
echo.
214+
set /p ColorCode=
215+
echo.Great! Does this look good?
216+
color %ColorCode%
217+
set /p YesNoColor=
218+
if not '%YesNoColor%'=='' set choice=%YesNoColor%:~0,1%
219+
if '%YesNoColor%'=='y' goto :SetColor
220+
if '%YesNoColor%'=='Y' goto :SetColor
221+
if '%YesNoColor%'=='Yes' goto :SetColor
222+
if '%YesNoColor%'=='yes' goto :SetColor
223+
if '%YesNoColor%'=='n' goto :color
224+
if '%YesNoColor%'=='N' goto :color
225+
if '%YesNoColor%'=='no' goto :color
226+
if '%YesNoColor%'=='No' goto :color
227+
ECHO. "%YesNoColor%" is not a valid option, please try again.
228+
goto :color
229+
230+
:: Some code to actually set the color code.
231+
:SetColor
232+
@echo on
233+
echo.Great! Would you like to save the color code
234+
echo.so that it is applied every time you start the
235+
echo.script?
236+
set /p YesNoColor2=
237+
if not '%YesNoColo2r%'=='' set choice=%YesNoColor2%:~0,1%
238+
if '%YesNoColor2%'=='y' goto :SetColor2
239+
if '%YesNoColor2%'=='Y' goto :SetColor2
240+
if '%YesNoColor2%'=='Yes' goto :SetColor2
241+
if '%YesNoColor2%'=='yes' goto :SetColor2
242+
if '%YesNoColor2%'=='n' goto :MainMenu
243+
if '%YesNoColor2%'=='N' goto :MainMenu
244+
if '%YesNoColor2%'=='no' goto :MainMenu
245+
if '%YesNoColor2%'=='No' goto :MainMenu
246+
ECHO. "%YesNoColor%" is not a valid option, please try again.
247+
goto :color
248+
249+
:: Some code to for real this time set the color code.
250+
:SetColor2
251+
@echo on
252+
echo %ColorCode% > Color.txt
253+
set /p VerifyColorCode= < Color.txt
254+
pause
255+
if not '%ColorCode% '=='%VerifyColorCode%' echo. Something went wrong when saving the color code,
256+
if not '%ColorCode% '=='%VerifyColorCode%' echo. please report this to the developer and give
257+
if not '%ColorCode% '=='%VerifyColorCode%' echo. the error code "2".
258+
pause
259+
161260

162261
:: Simplest one of them all, exits the shell
163262
:exit

0 commit comments

Comments
 (0)