Skip to content

Commit

Permalink
Update AutoRunWithCMD.cmd
Browse files Browse the repository at this point in the history
Add a true debug menu, many more things, and a (mostly) broken font color switcher, no CLUE why it doesn't work.
  • Loading branch information
techflashYT committed Aug 19, 2021
1 parent edae4ac commit 81565a6
Showing 1 changed file with 102 additions and 3 deletions.
105 changes: 102 additions & 3 deletions AutoRunWithCMD.cmd
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
:: Sets the color, disables command feedback, and clears the screen of the version and whatnot text.
@echo off
cls
color 0a
cd %appdata%
:: Debug stuff, making a place for logs
if exist "Sanikdah Software" (
Expand Down Expand Up @@ -85,9 +84,9 @@ goto :MainMenu

:: Main menu code, sets the title, adds 2 blank lines, and eventually a working choice system.
:MainMenu
@echo off
title Welcome! What would you like to do?
echo.
echo.
echo This is a placeholder menu until I design a real one!
goto :Choice
echo.>MainMenuTriggered.txt
Expand All @@ -100,25 +99,46 @@ echo.
echo. 1: Go to the regular command line and run your own commands!
echo. 2: Test your internet connection by pinging Google!
echo. 3: Repair your system by running DISM and System File Checker!
echo. 4: Get your public IP!
echo. 5: Check network statistics!
echo. 8: Settings
echo. 9: Access Help
set /p choice= Your choice?=
if not '%choice%'=='' set choice=%choice:~0,1%
if '%choice%'=='1' goto :GoToRegularCMD
if '%choice%'=='2' goto :PingGoogle
if '%choice%'=='3' goto :DISMandSFC
if '%choice%'=='4' goto :CurlIPme
if '%choice%'=='5= goto :CheckNetworkStatistics
if '%choice%'=='exit' goto :exit
if '%choice%'=='leave' goto :exit
if '%choice%'=='die' goto :exit
if '%choice%'=='debug' goto :debug
if '%choice%'=='8' goto :Settings
if '%choice%'=='9' goto :Help
ECHO "%choice%" is not a valid option, please try again.
ECHO.
goto :Choice
echo.>EndOfChoiceTriggered.txt


:CurlIPme
@echo off
title Please Wait....
echo Getting your IP....
curl ip.me > TempIP.txt
set /p IP= < TempIP.txt
del TempIP.txt
echo Your public IP is %IP%
set %IP%=
goto :MainMenu

:CheckNetworkStatistics


:GoToRegularCMD
@echo off
title Command Prompt
goto :leave
echo.>EndOfGoToRegualarCMDTriggered.txt

Expand All @@ -138,6 +158,7 @@ echo.>EndOfPingGoogleTriggered.txt
:debug
@echo off
cls
title WARNING
echo.====WARNING========WARNING=======WARNING=====
echo.====WARNING========WARNING=======WARNING=====
echo.====WARNING========WARNING=======WARNING=====
Expand All @@ -157,7 +178,85 @@ echo No debug 4 u
ping techflash.ga -n 1 > nul
goto :noDebug

:: Debug options don't exist as it would be accessible even if you didn't aggree to the terms.
:realDebug
echo Nothing here yet, currently working on the menu.
goto :MainMenu

:useBetterGrammarDebug
echo Use better grammar next time, CAPITALIZE >:(
goto :realDebug

:: Settings menu
:Settings
@echo off
cls
echo.Welcome to the settings menu! Here you can modify some settings!
echo.1: Modify the default color when you start the script.
echo.2: Not yet created just felt like adding this here. :P
set /p SettingsChoice=
if '%SettingsChoice%'=='1' goto :color
if '%isSureOfDebugOptions%'=='2' goto :Nothing

:: 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.
:Nothing
@echo off
echo Nothing here yet! There might be soon O_O
echo. Going back to settings in 5 seconds.
timeout 5
goto :Settings

:: A basic section of code for setting the default color of the shell.
:color
@echo off
echo.Welcome to the color selection menu!
echo.Please enter a Command Prompt-format color code.
echo.
set /p ColorCode=
echo.Great! Does this look good?
color %ColorCode%
set /p YesNoColor=
if not '%YesNoColor%'=='' set choice=%YesNoColor%:~0,1%
if '%YesNoColor%'=='y' goto :SetColor
if '%YesNoColor%'=='Y' goto :SetColor
if '%YesNoColor%'=='Yes' goto :SetColor
if '%YesNoColor%'=='yes' goto :SetColor
if '%YesNoColor%'=='n' goto :color
if '%YesNoColor%'=='N' goto :color
if '%YesNoColor%'=='no' goto :color
if '%YesNoColor%'=='No' goto :color
ECHO. "%YesNoColor%" is not a valid option, please try again.
goto :color

:: Some code to actually set the color code.
:SetColor
@echo on
echo.Great! Would you like to save the color code
echo.so that it is applied every time you start the
echo.script?
set /p YesNoColor2=
if not '%YesNoColo2r%'=='' set choice=%YesNoColor2%:~0,1%
if '%YesNoColor2%'=='y' goto :SetColor2
if '%YesNoColor2%'=='Y' goto :SetColor2
if '%YesNoColor2%'=='Yes' goto :SetColor2
if '%YesNoColor2%'=='yes' goto :SetColor2
if '%YesNoColor2%'=='n' goto :MainMenu
if '%YesNoColor2%'=='N' goto :MainMenu
if '%YesNoColor2%'=='no' goto :MainMenu
if '%YesNoColor2%'=='No' goto :MainMenu
ECHO. "%YesNoColor%" is not a valid option, please try again.
goto :color

:: Some code to for real this time set the color code.
:SetColor2
@echo on
echo %ColorCode% > Color.txt
set /p VerifyColorCode= < Color.txt
pause
if not '%ColorCode% '=='%VerifyColorCode%' echo. Something went wrong when saving the color code,
if not '%ColorCode% '=='%VerifyColorCode%' echo. please report this to the developer and give
if not '%ColorCode% '=='%VerifyColorCode%' echo. the error code "2".
pause


:: Simplest one of them all, exits the shell
:exit
Expand Down

0 comments on commit 81565a6

Please sign in to comment.