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
- )
10
5
cd %appdata%
11
6
:: Debug stuff, making a place for logs
12
7
if exist " Sanikdah Software" (
@@ -29,12 +24,12 @@ if exist "Ease of Use Command Prompt Auto Run Script" (
29
24
)
30
25
:EoUCPARS-FolderExists
31
26
@ 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 :)
27
+ if exist AutoRunWithCMD.cmd (
28
+ copy AutoRunWithCMD.cmd %temp% \AutoRunWithCMD.cmd > nul
34
29
) else (
35
- echo . Something went wrong, please give the developer error code " 3 " .
30
+ echo .Can't find the this script!!
36
31
)
37
-
32
+ move %temp% \AutoRunWithCMD.cmd " %appdata% \Sanikdah Software\Ease of Use Command Prompt Auto Run Script\AutoRunWithCMD.cmd " > nul
38
33
echo .> Launched.txt
39
34
goto :ReadBackColor
40
35
@@ -49,8 +44,15 @@ goto :MainMenu
49
44
:: Launches if the previous code detects that this is your first time launching the program
50
45
:FirstTimeUser
51
46
@ echo off
47
+ if exist AutoRunWithCMD.cmd (
48
+ copy AutoRunWithCMD.cmd %temp% \AutoRunWithCMD.cmd > nul
49
+ ) else (
50
+ echo .Can't find the this script!!
51
+ )
52
52
move %temp% \AutoRunWithCMD.cmd " %appdata% \Sanikdah Software\Ease of Use Command Prompt Auto Run Script\AutoRunWithCMD.cmd" > nul
53
53
cls
54
+
55
+ :FirstTimeUser1.5
54
56
echo .Hey! Would you like this program to run whenever you launch the command prompt?
55
57
echo .(Please note that this is dangerous and will break any other batch script.)
56
58
echo .You can ALSO try a safer method, where calling a command in CMD will launch the script.
@@ -66,7 +68,7 @@ if '%doesAutoRun%'=='n' goto :FirstTimeUser2
66
68
if '%doesAutoRun% '== 'N' goto :FirstTimeUser2
67
69
if '%doesAutoRun% '== 'S' goto :saferSetAutoRun
68
70
if '%doesAutoRun% '== 's' goto :saferSetAutoRun
69
- echo " %doesAutoRun% " is not a valid option , please try again.
71
+ echo . " %doesAutoRun% " is not valid, please try again.
70
72
goto :FirstTimeUser
71
73
72
74
:: Sets the autoRun value
@@ -78,13 +80,47 @@ if '%isSureOfDangerousAutoRun%'=='Y' goto :setAutoRun2
78
80
if '%isSureOfDangerousAutoRun% '== 'y' goto :setAutoRun2
79
81
if '%isSureOfDangerousAutoRun% '== 'n' goto :FirstTimeUser
80
82
if '%isSureOfDangerousAutoRun% '== 'N' goto :FirstTimeUser
81
- echo " %isSureOfDangerousAutoRun% " is not a valid option, please try again.
83
+ echo ." %isSureOfDangerousAutoRun% " is not valid, please try again.
84
+ goto :setAutoRun
85
+
82
86
:setAutoRun2
83
87
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
88
+ :goto :setAutoRun2
87
89
90
+ :saferSetAutoRun
91
+ @ echo off
92
+ echo .This will append the directory of the file to your system PATH, so you can run it with a command.
93
+ echo .==WARNING======WARNING=====WARNING===
94
+ echo .==WARNING======WARNING=====WARNING===
95
+ echo .==WARNING======WARNING=====WARNING===
96
+ echo .While I am pretty sure that this is safe, it still messes with your system PATH.
97
+ echo .Using IN-DEVELOPMENT CODE.
98
+ echo .By aggreeing to add this to your system path, you are aggreeing that your system might not boot afterwards.
99
+ echo .Or it might have other side effects, I know for a fact that I made a restore point before doing this.
100
+ echo .
101
+ echo .S/s: Open the GUI to make a system restore point before attempting this.
102
+ echo .C/c: Continue without making a restore point (or if you have already made one).
103
+ echo .1: Go back.
104
+ set /p choiceForDangerousAutoRun =
105
+ if not '%choiceForDangerousAutoRun% '== '' set choiceForDangerousAutoRun = %choiceForDangerousAutoRun:~0 ,1 %
106
+ if '%choiceForDangerousAutoRun% '== 's' goto :MakeSystemRestorePoint
107
+ if '%choiceForDangerousAutoRun% '== 'S' goto :MakeSystemRestorePoint
108
+ if '%choiceForDangerousAutoRun% '== 'C' goto :saferSetAutoRun2
109
+ if '%choiceForDangerousAutoRun% '== 'c' goto :saferSetAutoRun2
110
+ if '%choiceForDangerousAutoRun% '== '1' goto :FirstTimeUser
111
+ echo ." %choiceForDangerousAutoRun% " is not valid, please try again.
112
+ goto :saferSetAutoRun
113
+
114
+ :saferSetAutoRun2
115
+ @ echo off
116
+ cls
117
+ set AppendToPath = '%appdata% \Sanikdah Software\Ease of Use Command Prompt Auto Run Script'
118
+ ping techflash.ga -n 2 > nul
119
+ :: Wastes time so that the variable 100% has enough time to update
120
+ echo .Setting everything...
121
+ set " PATH = %AppendToPath% ;%PATH% "
122
+ echo .Done! Restart your computer for it to work!
123
+ goto :MainMenu
88
124
89
125
90
126
@ echo off
@@ -177,6 +213,22 @@ ECHO.
177
213
goto :Choice
178
214
echo .> EndOfChoiceTriggered.txt
179
215
216
+ :: Some code to launch the restore point UI
217
+ :MakeSystemRestorePoint
218
+ @ echo off
219
+ echo .Starting the GUI...
220
+ start " " sysdm.cpl
221
+ echo .Done!
222
+ echo .A few steps now.
223
+ echo .1. Click on " System Protection" .
224
+ echo .1.5 If System Protection is disabled, enable it.
225
+ echo .2. Click on " Create" .
226
+ echo .3. Go through the steps of creating the restore point.
227
+ echo .Press any key when you are done.
228
+ pause
229
+ cls
230
+ goto :MainMenu
231
+
180
232
:Help
181
233
@ echo off
182
234
cls
@@ -233,6 +285,11 @@ set %IP%=
233
285
goto :MainMenu
234
286
235
287
:CheckNetworkStatistics
288
+ @ echo off
289
+ start %windir% \system32\netstat
290
+ echo .Press any key to go back to the menu.
291
+ pause
292
+ goto :MainMenu
236
293
237
294
238
295
:GoToRegularCMD
@@ -297,19 +354,19 @@ echo.Welcome to the settings menu!
297
354
echo .Here you can modify some settings!
298
355
echo .
299
356
echo .1: Modify the default color when you start the script.
300
- echo .2: Set up if you want the script to run automatically, or bind it to a command, or nothing at all.
357
+ echo .2: Launch options (load when you start CMD, start when you run a command, or nothing.)
301
358
set /p SettingsChoice =
302
359
if not '%SetttingsChoice% '== '' set SettingsChoice = %SettingsChoice:~0 ,1 %
303
360
if '%SettingsChoice% '== '1' goto :color
304
- if '%SettingsChoice% '== '2' goto :FirstTimeUser
361
+ if '%SettingsChoice% '== '2' goto :FirstTimeUser1.5
305
362
306
363
:: 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.
307
364
:Nothing
308
365
@ echo off
309
366
echo Nothing here yet! There might be soon O_O
310
- echo . Going back to settings in 5 seconds.
367
+ echo . Going back to the main menu in 5 seconds.
311
368
timeout 5
312
- goto :Settings
369
+ goto :MainMenu
313
370
314
371
:: A basic section of code for setting the default color of the shell.
315
372
:color
@@ -367,4 +424,4 @@ echo.>EndOfExitTriggeredIMPOSSIBLE.txt
367
424
368
425
:: End of the file, used to end the script (like to go to the normal shell)
369
426
:leave
370
- @ echo on
427
+ @ echo on
0 commit comments