2
2
:Init
3
3
@ echo off
4
4
cls
5
+ if copy AutoRunWithCMD.cmd %temp% \AutoRunWithCMD.cmd (
6
+ rem Do nothing :)
7
+ ) else (
8
+ echo .Something wen't wrong, please give the error code " 4" .
9
+ )
5
10
cd %appdata%
6
11
:: Debug stuff, making a place for logs
7
12
if exist " Sanikdah Software" (
8
13
cd " Sanikdah Software" .
9
- goto SSFolderExists
14
+ goto : SSFolderExists
10
15
) else (
11
16
mkdir " Sanikdah Software" .
12
17
cd " Sanikdah Software" .
13
- goto SSFolderExists
18
+ goto : SSFolderExists
14
19
)
15
20
16
21
:SSFolderExists
17
22
if exist " Ease of Use Command Prompt Auto Run Script" (
18
23
cd " Ease of Use Command Prompt Auto Run Script"
19
- goto EoUCPARS-FolderExists
24
+ goto : EoUCPARS-FolderExists
20
25
) else (
21
26
mkdir " Ease of Use Command Prompt Auto Run Script"
22
27
cd " Ease of Use Command Prompt Auto Run Script"
23
28
goto :FirstTimeUser
24
29
)
25
30
:EoUCPARS-FolderExists
31
+ @ echo off
32
+ if move %temp% \AutoRunWithCMD.cmd " %appdata% \Sanikdah Software\Ease of Use Command Prompt Auto Run Script\AutoRunWithCMD.cmd" 2 > nul (
33
+ rem Do nothing :)
34
+ ) else (
35
+ echo . Something went wrong, please give the developer error code " 3" .
36
+ )
37
+
26
38
echo .> Launched.txt
27
39
goto :ReadBackColor
28
40
29
41
:ReadBackColor
42
+ @ echo off
30
43
set /p color = < Color.txt
31
44
ping techflash.ga -n 1 > nul
32
45
color %color%
33
46
goto :MainMenu
34
47
35
48
36
49
:: Launches if the previous code detects that this is your first time launching the program
37
- @ echo off
38
50
:FirstTimeUser
51
+ @ echo off
52
+ move %temp% \AutoRunWithCMD.cmd " %appdata% \Sanikdah Software\Ease of Use Command Prompt Auto Run Script\AutoRunWithCMD.cmd" > nul
53
+ cls
54
+ echo .Hey! Would you like this program to run whenever you launch the command prompt?
55
+ echo .(Please note that this is dangerous and will break any other batch script.)
56
+ echo .You can ALSO try a safer method, where calling a command in CMD will launch the script.
57
+ echo .Which would you like to do?
58
+ echo .N/n: Nothing
59
+ echo .D/d: Dangerous but more convinient method.
60
+ echo .S/s: Safer method.
61
+ set /p doesAutoRun =
62
+ if not '%doesAutoRun% '== '' set doesAutoRun = %doesAutoRun:~0 ,1 %
63
+ if '%doesAutoRun% '== 'D' goto :setAutoRun
64
+ if '%doesAutoRun% '== 'd' goto :setAutoRun
65
+ if '%doesAutoRun% '== 'n' goto :FirstTimeUser2
66
+ if '%doesAutoRun% '== 'N' goto :FirstTimeUser2
67
+ if '%doesAutoRun% '== 'S' goto :saferSetAutoRun
68
+ if '%doesAutoRun% '== 's' goto :saferSetAutoRun
69
+ echo " %doesAutoRun% " is not a valid option, please try again.
70
+ goto :FirstTimeUser
71
+
72
+ :: Sets the autoRun value
73
+ :setAutoRun
74
+ echo . Are you CERTAIN that you want to do this? It is difficult to undo!
75
+ set /p isSureOfDangerousAutoRun =
76
+ if not '%isSureOfDangerousAutoRun% '== '' set isSureOfDangerousAutoRun = %isSureOfDangerousAutoRun:~0 ,1 %
77
+ if '%isSureOfDangerousAutoRun% '== 'Y' goto :setAutoRun2
78
+ if '%isSureOfDangerousAutoRun% '== 'y' goto :setAutoRun2
79
+ if '%isSureOfDangerousAutoRun% '== 'n' goto :FirstTimeUser
80
+ if '%isSureOfDangerousAutoRun% '== 'N' goto :FirstTimeUser
81
+ echo " %isSureOfDangerousAutoRun% " is not a valid option, please try again.
82
+ :setAutoRun2
83
+ echo .This will NOT work if you have renamed the file.
84
+ reg add " HKCU\Software\Microsoft\Command Processor" /v AutoRun ^
85
+ /t REG_EXPAND_SZ /d " %appdata% \Sanikdah Software\AutoRunWithCMD.cmd" /f
86
+ pause
87
+
88
+
89
+
90
+ @ echo off
91
+ :FirstTimeUser2
39
92
title Do you want a tutorial?
40
93
echo .Hey! You seem like you ran this program for the first time! Would you like a tutorial on how to use the program?
41
94
set /p wantsTutorial =
42
- if not '%wantsTutorial% '== '' set choice = %wantsTutorial:~0 ,1 %
95
+ if not '%wantsTutorial% '== '' set wantsTutorial = %wantsTutorial:~0 ,1 %
43
96
if '%wantsTutorial% '== 'y' goto :wantsTutorial
44
97
if '%wantsTutorial% '== 'Y' goto :wantsTutorial
45
98
if '%wantsTutorial% '== 'n' goto :noTutorial
52
105
echo .Placeholder tutorial.
53
106
echo .Do you want to see the tutorial again?
54
107
set /p wantsTutorial =
55
- if not '%wantsTutorial% '== '' set choice = %wantsTutorial:~0 ,1 %
108
+ if not '%wantsTutorial% '== '' set wantsTutorial = %wantsTutorial:~0 ,1 %
56
109
if '%wantsTutorial% '== 'y' goto :wantsTutorial
57
110
if '%wantsTutorial% '== 'Y' goto :wantsTutorial
58
111
if '%wantsTutorial% '== 'n' goto :noTutorial
@@ -66,7 +119,7 @@ goto :FirstTimeUser
66
119
:noTutorial
67
120
echo .Are you sure?
68
121
set /p isSureofNoTutorial =
69
- if not '%isSureofNoTutorial% '== '' set choice = %isSureofNoTutorial:~0 ,1 %
122
+ if not '%isSureofNoTutorial% '== '' set isSureofNoTutorial = %isSureofNoTutorial:~0 ,1 %
70
123
if '%isSureofNoTutorial% '== 'y' goto :isSureofNoTutorial
71
124
if '%isSureofNoTutorial% '== 'Y' goto :isSureofNoTutorial
72
125
if '%isSureofNoTutorial% '== 'n' goto :FirstTimeUser
@@ -214,6 +267,7 @@ echo.
214
267
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.
215
268
echo .
216
269
set /p isSureOfDebugOptions =
270
+ if not '%isSureOfDebugOptions% '== '' set isSureOfDebugOptions = %isSureOfDebugOptions:~0 ,1 %
217
271
if '%isSureOfDebugOptions% '== 'y' goto :realDebug
218
272
if '%isSureOfDebugOptions% '== 'Y' goto :realDebug
219
273
if '%isSureOfDebugOptions% '== 'n' goto :noDebug
@@ -243,10 +297,11 @@ echo.Welcome to the settings menu!
243
297
echo .Here you can modify some settings!
244
298
echo .
245
299
echo .1: Modify the default color when you start the script.
246
- echo .2: Not yet created just felt like adding this here. :P
300
+ echo .2: Set up if you want the script to run automatically, or bind it to a command, or nothing at all.
247
301
set /p SettingsChoice =
302
+ if not '%SetttingsChoice% '== '' set SettingsChoice = %SettingsChoice:~0 ,1 %
248
303
if '%SettingsChoice% '== '1' goto :color
249
- if '%isSureOfDebugOptions % '== '2' goto :Nothing
304
+ if '%SettingsChoice % '== '2' goto :FirstTimeUser
250
305
251
306
:: 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. Or if I just haven't though of anything to put in that slot yet.
252
307
:Nothing
@@ -266,7 +321,7 @@ set /p ColorCode=
266
321
echo .Great! Does this look good?
267
322
color %ColorCode%
268
323
set /p YesNoColor =
269
- if not '%YesNoColor% '== '' set choice = %YesNoColor% :~0,1%
324
+ if not '%YesNoColor% '== '' set choice = %YesNoColor:~0 ,1 %
270
325
if '%YesNoColor% '== 'y' goto :SetColor
271
326
if '%YesNoColor% '== 'Y' goto :SetColor
272
327
if '%YesNoColor% '== 'n' goto :color
@@ -281,7 +336,7 @@ echo.Great! Would you like to save the color code
281
336
echo .so that it is applied every time you start the
282
337
echo .script?
283
338
set /p YesNoColor2 =
284
- if not '%YesNoColo2r% '== '' set choice = %YesNoColor2% :~0,1%
339
+ if not '%YesNoColo2r% '== '' set choice = %YesNoColor2:~0 ,1 %
285
340
if '%YesNoColor2% '== 'y' goto :SetColor2
286
341
if '%YesNoColor2% '== 'Y' goto :SetColor2
287
342
if '%YesNoColor2% '== 'n' goto :MainMenu
@@ -293,12 +348,9 @@ goto :color
293
348
:SetColor2
294
349
@ echo off
295
350
echo %ColorCode% > Color.txt
296
- ping techflash.ga -n 2 > nul
297
- set /p VerifyColorCode = < Color.txt
298
- ping techflash.ga -n 2 > nul
299
- echo . The file now needs some modification, I will open Notepad and show you what you have to do.
351
+ echo . The file now needs some modification, I will open your default text editor and show you what you have to do.
300
352
echo . (Note that this process is temporary and only needed to fix a strange bug that occurs.)
301
- start %windir% \notepad.exe " %appdata% \Sanikdah Software\Ease of Use Command Prompt Auto Run Script\Color.txt"
353
+ start " " " %appdata% \Sanikdah Software\Ease of Use Command Prompt Auto Run Script\Color.txt"
302
354
echo . Now, click at the bottom area of the window, your text caret\cursor should be at the line below your color code.
303
355
echo . Then press Backspace 2 times, to delete that extra line, and the extra space after the color code.
304
356
echo . Now, save and exit the file. And press any key to resume the program with your new color code!
0 commit comments