Skip to content

Commit

Permalink
Update AutoRunWithCMD.cmd
Browse files Browse the repository at this point in the history
Next major version, quite a few things changed.
  • Loading branch information
techflashYT committed Aug 20, 2021
1 parent 81565a6 commit 3ef2491
Showing 1 changed file with 43 additions and 35 deletions.
78 changes: 43 additions & 35 deletions AutoRunWithCMD.cmd
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
:: Sets the color, disables command feedback, and clears the screen of the version and whatnot text.
:Init
@echo off
cls
cd %appdata%
Expand All @@ -23,8 +24,15 @@ if exist "Ease of Use Command Prompt Auto Run Script" (
)
:EoUCPARS-FolderExists
echo.>Launched.txt
goto :ReadBackColor

:ReadBackColor
set /p color= < Color.txt
ping techflash.ga -n 1 > nul
color %color%
goto :MainMenu


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


:: Some code to make choices
:: NOTE TO FUTURE SELF:
:: 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.
:Choice
set choice=
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
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%'=='0' goto :debug
if '%choice%'=='8' goto :Settings
if '%choice%'=='9' goto :Help
ECHO "%choice%" is not a valid option, please try again.
Expand Down Expand Up @@ -165,10 +172,13 @@ echo.====WARNING========WARNING=======WARNING=====
echo.THESE ARE DEBUG OPTIONS AND **CAN** BREAK THE PROGRAM!!
echo.ARE YOU **101% POSITIVE** THAT YOU NEED THESE?
echo.
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.
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.
echo.
set /p isSureOfDebugOptions=
if '%isSureOfDebugOptions%'=='I understand' goto :realDebug
if '%isSureOfDebugOptions%'=='i understand' goto :useBetterGrammarDebug
if '%isSureOfDebugOptions%'=='y' goto :realDebug
if '%isSureOfDebugOptions%'=='Y' goto :realDebug
if '%isSureOfDebugOptions%'=='n' goto :noDebug
if '%isSureOfDebugOptions%'=='N' goto :noDebug
goto :noDebug


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

:realDebug
echo Nothing here yet, currently working on the menu.
echo.
echo Nothing here yet, currently working on the main menu.
echo.Press any key to go back to the Main menu.
pause
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.
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=
Expand All @@ -208,54 +218,52 @@ 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!
cls
echo.Welcome to the color selection menu! (BROKEN)
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 off
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 off
echo %ColorCode% > Color.txt
ping techflash.ga -n 2 > nul
set /p VerifyColorCode= < Color.txt
ping techflash.ga -n 2 > nul
echo. The file now needs some modification, I will open Notepad and show you what you have to do.
echo. (Note that this process is temporary and only needed to fix a strange bug that occurs.)
start %windir%\notepad.exe "%appdata%\Sanikdah Software\Ease of Use Command Prompt Auto Run Script\Color.txt"
echo. Now, click at the bottom area of the window, your text caret\cursor should be at the line below your color code.
echo. Then press Backspace 2 times, to delete that extra line, and the extra space after the color code.
echo. Now, save and exit the file. And press any key to resume the program with your new color code!
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
goto :Init



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

0 comments on commit 3ef2491

Please sign in to comment.