batchr.bat aktualisiert
This commit is contained in:
23
batchr.bat
23
batchr.bat
@@ -58,12 +58,23 @@ for /f "delims=" %%a in (%TEMP%\repo_scripts.txt) do (
|
|||||||
set /a INDEX+=1
|
set /a INDEX+=1
|
||||||
set "SCRIPT_NAME[!INDEX!]=!LINE!"
|
set "SCRIPT_NAME[!INDEX!]=!LINE!"
|
||||||
|
|
||||||
REM Format display name (remove .bat and replace separators)
|
REM Reset title variable
|
||||||
set "DISPLAY=!LINE:.bat=!"
|
set "SCRIPT_TITLE="
|
||||||
set "DISPLAY=!DISPLAY:-= !"
|
|
||||||
set "DISPLAY=!DISPLAY:_= !"
|
|
||||||
|
|
||||||
echo [!INDEX!] !DISPLAY!
|
REM Extract title using PowerShell
|
||||||
|
set "SCRIPT_URL=https://git.weektab.org/companas/batchr/raw/branch/main/files/!LINE!"
|
||||||
|
|
||||||
|
for /f "delims=" %%t in ('powershell -Command "$ProgressPreference = 'SilentlyContinue'; try { $content = (Invoke-WebRequest -Uri '!SCRIPT_URL!' -UseBasicParsing).Content; if ($content -match 'REM\s*===\s*(.+?)\s*===') { $matches[1] } else { '' } } catch { '' }"') do set "SCRIPT_TITLE=%%t"
|
||||||
|
|
||||||
|
REM Fallback to formatted filename if title not found
|
||||||
|
if "!SCRIPT_TITLE!"=="" (
|
||||||
|
set "SCRIPT_TITLE=!LINE:.bat=!"
|
||||||
|
set "SCRIPT_TITLE=!SCRIPT_TITLE:-= !"
|
||||||
|
set "SCRIPT_TITLE=!SCRIPT_TITLE:_= !"
|
||||||
|
)
|
||||||
|
|
||||||
|
set "DISPLAY[!INDEX!]=!SCRIPT_TITLE!"
|
||||||
|
echo [!INDEX!] !SCRIPT_TITLE!
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -100,7 +111,7 @@ if "%VALID%"=="0" (
|
|||||||
|
|
||||||
REM Execute script
|
REM Execute script
|
||||||
cls
|
cls
|
||||||
echo /// Executing: !SCRIPT_NAME[%CHOICE%]!
|
echo /// Executing: !DISPLAY[%CHOICE%]!
|
||||||
echo.
|
echo.
|
||||||
|
|
||||||
set "SCRIPT_URL=https://git.weektab.org/companas/batchr/raw/branch/main/files/!SCRIPT_NAME[%CHOICE%]!"
|
set "SCRIPT_URL=https://git.weektab.org/companas/batchr/raw/branch/main/files/!SCRIPT_NAME[%CHOICE%]!"
|
||||||
|
|||||||
Reference in New Issue
Block a user