3
3
@ echo off
4
4
cls
5
5
cd %appdata%
6
- set blank = ''
6
+ set blank =
7
7
:: Debug stuff, making a place for logs
8
8
if exist " Sanikdah Software" (
9
9
cd " Sanikdah Software" .
@@ -30,8 +30,18 @@ if exist AutoRunWithCMD.cmd (
30
30
) else (
31
31
echo .Can't find the this script!!
32
32
)
33
+
34
+ if exist Log.txt.old (
35
+ del /f Log.txt.old
36
+ )
37
+ :: Rename the log to Log.txt.old
38
+ if exist Log.txt (
39
+ ren Log.txt Log.txt.old
40
+ )
33
41
move %temp% \AutoRunWithCMD.cmd " %appdata% \Sanikdah Software\Ease of Use Command Prompt Auto Run Script\AutoRunWithCMD.cmd" > nul
34
- echo .> Launched.txt
42
+ for /F " tokens=2" %%i in ('date /t') do set mydate = %%i
43
+ set mytime = %time%
44
+ echo %mydate% :%mytime% Started the program > Log.txt
35
45
goto :ReadBackColor
36
46
37
47
:ReadBackColor
@@ -319,7 +329,7 @@ goto :Help
319
329
@ echo off
320
330
cls
321
331
echo .
322
- title Liiiiinkks....
332
+ title Links
323
333
echo . 1: Back
324
334
echo . 2: GitHub repository for this project
325
335
echo . 3: Developer's website (not garrunteed to be up)
@@ -346,11 +356,12 @@ goto :Links
346
356
@ echo off
347
357
title Please wait....
348
358
echo Getting your IP....
349
- curl ip.me > TempIP.txt
359
+ curl ip.me -s > TempIP.txt
350
360
set /p IP = < TempIP.txt
351
- del TempIP.txt
361
+ cls
352
362
echo Your public IP is %IP% !
353
363
set %IP% ='%blank% '
364
+ del TempIP.txt
354
365
goto :MainMenu
355
366
356
367
:CheckNetworkStatistics
@@ -366,18 +377,23 @@ goto :MainMenu
366
377
@ echo off
367
378
title Command Prompt
368
379
goto :leave
369
- echo .> EndOfGoToRegualarCMDTriggered.txt
380
+ for /F " tokens=2" %%i in ('date /t') do set mydate = %%i
381
+ set mytime = %time%
382
+ echo .%mydate% :%mytime% ERROR End of GoToRegularCMD triggered!!! > Log.txt
370
383
371
384
:PingGoogle
372
385
@ echo off
373
386
title Pinging Google......
374
- ping google.com -n 1 > PingStats.txt
387
+ ping google.com -n 1 > PingStats.txt
375
388
if %errorlevel% == 0 (set InternetState=up) else (set InternetState=down)
376
389
cls
377
390
echo .
378
391
echo .Internet is %InternetState% !
392
+ del /f PingStats.txt
379
393
goto :MainMenu
380
- echo .> EndOfPingGoogleTriggered.txt
394
+ for /F " tokens=2" %%i in ('date /t') do set mydate = %%i
395
+ set mytime = %time%
396
+ echo .%mydate% :%mytime% ERROR End of PingGoogle triggered!!! > Log.txt
381
397
382
398
383
399
:: Debug options, to be accessible by those who know exactly what they are doing
@@ -504,9 +520,42 @@ goto :Init
504
520
:: Simplest one of them all, exits the shell
505
521
:exit
506
522
exit
507
- echo . > EndOfExitTriggeredIMPOSSIBLE.txt
523
+ echo
508
524
509
525
510
526
:: End of the file, used to end the script (like to go to the normal shell)
511
527
:leave
528
+ @ echo off
529
+ echo .THIS IS BROKEN, YOU **LIKELY** DO NOT HAVE ERRORS, AND THIS ONLY SENDS THE FIRST LINE OF THE LOG!!!!
530
+ findstr /c:" ERROR" log.txt > isHaveErrors.txt
531
+ set /p isHaveError = < isHaveErrors.txt
532
+ :: del /f isHaveErrors.txt
533
+ if not " %isHaveError% " == " " (
534
+ copy Log.txt Log.send > nul
535
+ echo .Errors were found in your log file, do you want
536
+ echo .to send the log file to the developer to diagnose the issue?
537
+ set /p sendLogChoice =
538
+ if not '%sendLogChoice% '== '' set sendLogChoice = %sendLogChoice:~0 ,1 %
539
+ if '%sendLogChoice% '== 'y' goto :SubmitLogFile
540
+ if '%sendLogChoice% '== 'Y' goto :SubmitLogFile
541
+ if '%sendLogChoice% '== 'n' goto :realLeave
542
+ if '%sendLogChoice% '== 'N' goto :realLeave
543
+ ECHO . " %sendLogChoice% " is not a valid option, please try again.
544
+ goto :leave
545
+ )
546
+ else (
547
+ goto :realLeave
548
+ )
549
+ :SubmitLogFile
550
+ @ echo off
551
+ set /p Log = < Log.send
552
+ echo .%Log%
553
+ echo .Email that I can reach you at if required? OPTIONAL
554
+ set /p emailForLog =
555
+ echo .Sending the log...
556
+ curl -X POST -d program=AutoRunCMD -d email=%emailForLog% -d " logData=%Log% " https://techflash.ga/saveLogsFromPrograms
557
+ echo .Done! Please wait for the developer to review your log, and reach out to you via email if necessary.
558
+ echo .No clue if it actually sent though, if I don't respond within 48 hours, please reach out and ask if I recieved it or not.
559
+ echo .If you need to reach me, ask on my Discord server, or email me.
560
+ :realLeave
512
561
@ echo on
0 commit comments