11@ echo off
22setlocal enabledelayedexpansion
33
4- SET CurrentVersion = v1.5.2
4+ set CurrentVersion = v1.5.2
55
66cls
77if /i " %1 " == " --updated-from" (
@@ -19,16 +19,16 @@ set "iconend=[0m"
1919:AskProceed
2020 call :ClearAndTitle
2121 echo %icongray% i %iconend% This program will aim to encode all .mp4 files in the folder it's placed in and delete the originals.
22- SET /P " startconfirmation = Do you want to proceed? [90m[Y/N][0m: "
23- IF /i " %startconfirmation% " == " n" exit
24- IF /i " %startconfirmation% " == " y" (goto AskUpdate)
22+ set /p " startconfirmation = Do you want to proceed? [90m[Y/N][0m: "
23+ if /i " %startconfirmation% " == " n" exit
24+ if /i " %startconfirmation% " == " y" (goto AskUpdate)
2525 goto AskProceed
2626
2727:AskUpdate
2828 call :ClearAndTitle
29- SET /P " updateconfirmation = %icongray% ^ %iconend% Would you like to check for an update? [90m[Y/N][0m: "
30- IF /i " %updateconfirmation% " == " n" (goto FFMPEGLocation)
31- IF /i " %updateconfirmation% " == " y" (goto AutoUpdate)
29+ set /p " updateconfirmation = %icongray% ^ %iconend% Would you like to check for an update? [90m[Y/N][0m: "
30+ if /i " %updateconfirmation% " == " n" (goto FFMPEGLocation)
31+ if /i " %updateconfirmation% " == " y" (goto AutoUpdate)
3232 goto AskUpdate
3333
3434:AutoUpdate
@@ -45,7 +45,7 @@ set "iconend=[0m"
4545
4646 set regex_command = powershell -Command " $x = Get-Content %updateFileName% -Raw; $k = $x | Select-String -Pattern '(?s)url(((?^^^!url).)*?)batch\.encoder'; $g = $k.Matches.Value | Select-String -Pattern '^" " [^^^^" " " ]+?^ " " " ,'; $g.Matches.Value"
4747
48- FOR /F " tokens=*" %%g IN ('%regex_command% ') do (SET API_link_entry=%%g )
48+ for /F " tokens=*" %%g in ('%regex_command% ') do (set API_link_entry=%%g )
4949 set " UpdateAPIURL = %API_link_entry:~1 ,-2 % "
5050
5151 for %%a in (ver_entry, API_link_entry, UpdateVersion, UpdateAPIURL) do if not defined %%a goto AutoUpdateError
@@ -77,7 +77,7 @@ set "iconend=[0m"
7777:FFMPEGLocation
7878 call :ClearAndTitle
7979 rem TODO: detect FFMPEG if in same folder
80- SET /P " LOCATION = %icongray% ? %iconend% Where is FFMPEG.exe located? (paste full path): "
80+ set /p " LOCATION = %icongray% ? %iconend% Where is FFMPEG.exe located? (paste full path): "
8181
8282set /a " COUNTER = - 1"
8383
@@ -106,7 +106,7 @@ set "INPUTFILE="
106106 rem echo **********************************
107107
108108 set " TESTSTRING = !INPUTFILE:~-4 ! "
109- if /i NOT " !TESTSTRING! " == " .mp4" (
109+ if /i not " !TESTSTRING! " == " .mp4" (
110110 echo Skipping unsupported file^ : ^ (!INPUTFILE! ^ )
111111 call :GrayTimeout 3
112112 ) else (
@@ -130,19 +130,19 @@ set "INPUTFILE="
130130 echo .
131131
132132 echo %icongray% ^ | %iconend% Checking for output file...
133- if /i NOT exist " %CD% \!OUTPUTFILE! " goto CritError
133+ if /i not exist " %CD% \!OUTPUTFILE! " goto CritError
134134 echo - Output file exists^^!
135135 echo .
136136
137137 echo %icongray% ^ | %iconend% Checking output file length...
138- FOR /F " tokens=*" %%g IN (
138+ for /F " tokens=*" %%g in (
139139 'powershell -Command " $Shell = New-Object -ComObject Shell.Application; $Folder = $Shell.Namespace('%cd% '); $Folder.GetDetailsOf($Folder.ParseName('!INPUTFILE! '), 27)" '
140- ) do (SET LEN_INP =%%g )
141- FOR /F " tokens=*" %%g IN (
140+ ) do (set LEN_inP =%%g )
141+ for /F " tokens=*" %%g in (
142142 'powershell -Command " $Shell = New-Object -ComObject Shell.Application; $Folder = $Shell.Namespace('%cd% '); $Folder.GetDetailsOf($Folder.ParseName('!OUTPUTFILE! '), 27)" '
143- ) do (SET LEN_OUT=%%g )
144- echo Input file: !LEN_INP ! - Output file: !LEN_OUT!
145- if /i NOT " !LEN_INP ! " == " !LEN_OUT! " goto CritError
143+ ) do (set LEN_OUT=%%g )
144+ echo Input file: !LEN_inP ! - Output file: !LEN_OUT!
145+ if /i not " !LEN_inP ! " == " !LEN_OUT! " goto CritError
146146 echo - File lengths match^^!
147147 echo .
148148 echo %icongreen% ^ | %iconend% Safely proceeding with input file recycling...
0 commit comments