Skip to content

Commit 3ef2491

Browse files
committed
Update AutoRunWithCMD.cmd
Next major version, quite a few things changed.
1 parent 81565a6 commit 3ef2491

File tree

1 file changed

+43
-35
lines changed

1 file changed

+43
-35
lines changed

AutoRunWithCMD.cmd

Lines changed: 43 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
:: Sets the color, disables command feedback, and clears the screen of the version and whatnot text.
2+
:Init
23
@echo off
34
cls
45
cd %appdata%
@@ -23,8 +24,15 @@ if exist "Ease of Use Command Prompt Auto Run Script" (
2324
)
2425
:EoUCPARS-FolderExists
2526
echo.>Launched.txt
27+
goto :ReadBackColor
28+
29+
:ReadBackColor
30+
set /p color= < Color.txt
31+
ping techflash.ga -n 1 > nul
32+
color %color%
2633
goto :MainMenu
2734

35+
2836
:: Launches if the previous code detects that this is your first time launching the program
2937
:FirstTimeUser
3038
title Do you want a tutorial?
@@ -93,27 +101,26 @@ echo.>MainMenuTriggered.txt
93101

94102

95103
:: Some code to make choices
104+
:: NOTE TO FUTURE SELF:
105+
:: For some reason this code only allows for a SINGLE character to be used as a choice thingy, so like, 0-9 is fine, but not 10, etc.
96106
:Choice
97107
set choice=
98108
echo.
99-
echo. 1: Go to the regular command line and run your own commands!
100-
echo. 2: Test your internet connection by pinging Google!
101-
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
105-
echo. 9: Access Help
109+
echo. 1: Go to the regular command line and run your own commands!
110+
echo. 2: Test your internet connection by pinging Google!
111+
echo. 3: Repair your system by running DISM and System File Checker!
112+
echo. 4: Get your public IP!
113+
echo. 5: Check network statistics!
114+
echo. 8: Settings
115+
echo. 9: Access Help
106116
set /p choice= Your choice?=
107117
if not '%choice%'=='' set choice=%choice:~0,1%
108118
if '%choice%'=='1' goto :GoToRegularCMD
109119
if '%choice%'=='2' goto :PingGoogle
110120
if '%choice%'=='3' goto :DISMandSFC
111121
if '%choice%'=='4' goto :CurlIPme
112122
if '%choice%'=='5= goto :CheckNetworkStatistics
113-
if '%choice%'=='exit' goto :exit
114-
if '%choice%'=='leave' goto :exit
115-
if '%choice%'=='die' goto :exit
116-
if '%choice%'=='debug' goto :debug
123+
if '%choice%'=='0' goto :debug
117124
if '%choice%'=='8' goto :Settings
118125
if '%choice%'=='9' goto :Help
119126
ECHO "%choice%" is not a valid option, please try again.
@@ -165,10 +172,13 @@ echo.====WARNING========WARNING=======WARNING=====
165172
echo.THESE ARE DEBUG OPTIONS AND **CAN** BREAK THE PROGRAM!!
166173
echo.ARE YOU **101% POSITIVE** THAT YOU NEED THESE?
167174
echo.
168-
echo.Say "I understand", to prove the you understand this aggreement: The creator takes no responsibilty in what can happen if I, the user, breaks part of the program, by using explictly stated as options for DEBUGGING purposes.
175+
echo.Do you understand this aggreement? The creator takes no responsibilty in what can happen if I, the user, breaks part of the program, by using explictly stated as options for DEBUGGING purposes.
176+
echo.
169177
set /p isSureOfDebugOptions=
170-
if '%isSureOfDebugOptions%'=='I understand' goto :realDebug
171-
if '%isSureOfDebugOptions%'=='i understand' goto :useBetterGrammarDebug
178+
if '%isSureOfDebugOptions%'=='y' goto :realDebug
179+
if '%isSureOfDebugOptions%'=='Y' goto :realDebug
180+
if '%isSureOfDebugOptions%'=='n' goto :noDebug
181+
if '%isSureOfDebugOptions%'=='N' goto :noDebug
172182
goto :noDebug
173183

174184

@@ -179,18 +189,18 @@ ping techflash.ga -n 1 > nul
179189
goto :noDebug
180190

181191
:realDebug
182-
echo Nothing here yet, currently working on the menu.
192+
echo.
193+
echo Nothing here yet, currently working on the main menu.
194+
echo.Press any key to go back to the Main menu.
195+
pause
183196
goto :MainMenu
184197

185-
:useBetterGrammarDebug
186-
echo Use better grammar next time, CAPITALIZE >:(
187-
goto :realDebug
188-
189198
:: Settings menu
190199
:Settings
191200
@echo off
192201
cls
193202
echo.Welcome to the settings menu! Here you can modify some settings!
203+
echo.
194204
echo.1: Modify the default color when you start the script.
195205
echo.2: Not yet created just felt like adding this here. :P
196206
set /p SettingsChoice=
@@ -208,54 +218,52 @@ goto :Settings
208218
:: A basic section of code for setting the default color of the shell.
209219
:color
210220
@echo off
211-
echo.Welcome to the color selection menu!
221+
cls
222+
echo.Welcome to the color selection menu! (BROKEN)
212223
echo.Please enter a Command Prompt-format color code.
213-
echo.
214224
set /p ColorCode=
215225
echo.Great! Does this look good?
216226
color %ColorCode%
217227
set /p YesNoColor=
218228
if not '%YesNoColor%'=='' set choice=%YesNoColor%:~0,1%
219229
if '%YesNoColor%'=='y' goto :SetColor
220230
if '%YesNoColor%'=='Y' goto :SetColor
221-
if '%YesNoColor%'=='Yes' goto :SetColor
222-
if '%YesNoColor%'=='yes' goto :SetColor
223231
if '%YesNoColor%'=='n' goto :color
224232
if '%YesNoColor%'=='N' goto :color
225-
if '%YesNoColor%'=='no' goto :color
226-
if '%YesNoColor%'=='No' goto :color
227233
ECHO. "%YesNoColor%" is not a valid option, please try again.
228234
goto :color
229235

230236
:: Some code to actually set the color code.
231237
:SetColor
232-
@echo on
238+
@echo off
233239
echo.Great! Would you like to save the color code
234240
echo.so that it is applied every time you start the
235241
echo.script?
236242
set /p YesNoColor2=
237243
if not '%YesNoColo2r%'=='' set choice=%YesNoColor2%:~0,1%
238244
if '%YesNoColor2%'=='y' goto :SetColor2
239245
if '%YesNoColor2%'=='Y' goto :SetColor2
240-
if '%YesNoColor2%'=='Yes' goto :SetColor2
241-
if '%YesNoColor2%'=='yes' goto :SetColor2
242246
if '%YesNoColor2%'=='n' goto :MainMenu
243247
if '%YesNoColor2%'=='N' goto :MainMenu
244-
if '%YesNoColor2%'=='no' goto :MainMenu
245-
if '%YesNoColor2%'=='No' goto :MainMenu
246248
ECHO. "%YesNoColor%" is not a valid option, please try again.
247249
goto :color
248250

249251
:: Some code to for real this time set the color code.
250252
:SetColor2
251-
@echo on
253+
@echo off
252254
echo %ColorCode% > Color.txt
255+
ping techflash.ga -n 2 > nul
253256
set /p VerifyColorCode= < Color.txt
257+
ping techflash.ga -n 2 > nul
258+
echo. The file now needs some modification, I will open Notepad and show you what you have to do.
259+
echo. (Note that this process is temporary and only needed to fix a strange bug that occurs.)
260+
start %windir%\notepad.exe "%appdata%\Sanikdah Software\Ease of Use Command Prompt Auto Run Script\Color.txt"
261+
echo. Now, click at the bottom area of the window, your text caret\cursor should be at the line below your color code.
262+
echo. Then press Backspace 2 times, to delete that extra line, and the extra space after the color code.
263+
echo. Now, save and exit the file. And press any key to resume the program with your new color code!
254264
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
265+
goto :Init
266+
259267

260268

261269
:: Simplest one of them all, exits the shell

0 commit comments

Comments
 (0)