portex.bat aktualisiert
This commit is contained in:
18
portex.bat
18
portex.bat
@@ -1,6 +1,6 @@
|
|||||||
@echo off
|
@echo off
|
||||||
REM === Batchr Menu Launcher ===
|
REM === Batchr Menu Launcher ===
|
||||||
REM Repository: https://git.weektab.org/companas/batchr
|
REM Repository: https://git.weektab.org/nexus/portex
|
||||||
REM Powered by Weektab
|
REM Powered by Weektab
|
||||||
REM Author: Flamur Veliqi (Netbie)
|
REM Author: Flamur Veliqi (Netbie)
|
||||||
|
|
||||||
@@ -13,8 +13,8 @@ echo.
|
|||||||
echo Powered by Weektab
|
echo Powered by Weektab
|
||||||
echo Web: www.weektab.org
|
echo Web: www.weektab.org
|
||||||
echo E-Mail: support@weektab.org
|
echo E-Mail: support@weektab.org
|
||||||
echo Project: Companas
|
echo Project: Portex
|
||||||
echo Repository: git.weektab.org/companas/batchr
|
echo Repository: git.weektab.org/nexus/portex
|
||||||
echo.
|
echo.
|
||||||
echo //////////////////////////////////////////////////
|
echo //////////////////////////////////////////////////
|
||||||
echo.
|
echo.
|
||||||
@@ -48,13 +48,13 @@ goto MAIN_MENU
|
|||||||
|
|
||||||
:MENU
|
:MENU
|
||||||
cls
|
cls
|
||||||
echo Batchr Menu Launcher - !CATEGORY_NAME!
|
echo Portex Menu Launcher - !CATEGORY_NAME!
|
||||||
echo.
|
echo.
|
||||||
echo Powered by Weektab
|
echo Powered by Weektab
|
||||||
echo Web: www.weektab.org
|
echo Web: www.weektab.org
|
||||||
echo E-Mail: support@weektab.org
|
echo E-Mail: support@weektab.org
|
||||||
echo Project: Companas
|
echo Project: Portex
|
||||||
echo Repository: git.weektab.org/companas/batchr
|
echo Repository: git.weektab.org/nexus/portex
|
||||||
echo Author: Flamur Veliqi (Netbie)
|
echo Author: Flamur Veliqi (Netbie)
|
||||||
echo.
|
echo.
|
||||||
echo //////////////////////////////////////////////////
|
echo //////////////////////////////////////////////////
|
||||||
@@ -63,7 +63,7 @@ echo Scanning /!SCRIPT_PATH! directory...
|
|||||||
echo.
|
echo.
|
||||||
|
|
||||||
REM Use Gitea API to list files in selected directory
|
REM Use Gitea API to list files in selected directory
|
||||||
powershell -Command "$ProgressPreference = 'SilentlyContinue'; try { $response = Invoke-RestMethod -Uri 'https://git.weektab.org/api/v1/repos/companas/batchr/contents/!API_PATH!'; $batFiles = $response | Where-Object { $_.name -like '*.bat' } | Select-Object -ExpandProperty name | Sort-Object; if ($batFiles) { $batFiles | Out-File '%TEMP%\repo_scripts.txt' -Encoding ASCII -NoNewline:$false } else { 'NONE' | Out-File '%TEMP%\repo_scripts.txt' -Encoding ASCII } } catch { 'ERROR' | Out-File '%TEMP%\repo_scripts.txt' -Encoding ASCII }" 2>nul
|
powershell -Command "$ProgressPreference = 'SilentlyContinue'; try { $response = Invoke-RestMethod -Uri 'https://git.weektab.org/api/v1/repos/nexus/portex/contents/!API_PATH!'; $batFiles = $response | Where-Object { $_.name -like '*.bat' } | Select-Object -ExpandProperty name | Sort-Object; if ($batFiles) { $batFiles | Out-File '%TEMP%\repo_scripts.txt' -Encoding ASCII -NoNewline:$false } else { 'NONE' | Out-File '%TEMP%\repo_scripts.txt' -Encoding ASCII } } catch { 'ERROR' | Out-File '%TEMP%\repo_scripts.txt' -Encoding ASCII }" 2>nul
|
||||||
|
|
||||||
if not exist "%TEMP%\repo_scripts.txt" (
|
if not exist "%TEMP%\repo_scripts.txt" (
|
||||||
echo ERROR: Unable to access repository API
|
echo ERROR: Unable to access repository API
|
||||||
@@ -94,7 +94,7 @@ if "%FIRST_LINE%"=="NONE" (
|
|||||||
REM Get all script titles in one PowerShell call
|
REM Get all script titles in one PowerShell call
|
||||||
echo Extracting list...
|
echo Extracting list...
|
||||||
echo.
|
echo.
|
||||||
powershell -Command "$ProgressPreference = 'SilentlyContinue'; try { $files = Get-Content '%TEMP%\repo_scripts.txt'; $results = @(); foreach ($file in $files) { if ($file -and $file -ne '' -and $file -ne 'NONE' -and $file -ne 'ERROR') { try { $url = 'https://git.weektab.org/companas/batchr/raw/branch/main/!SCRIPT_PATH!/' + $file; $content = (Invoke-WebRequest -Uri $url -UseBasicParsing).Content; if ($content -match 'REM\s*===\s*(.+?)\s*===') { $results += $file + '|' + $matches[1] } else { $results += $file + '|' } } catch { $results += $file + '|' } } }; $results | Out-File '%TEMP%\repo_titles.txt' -Encoding ASCII } catch { }" 2>nul
|
powershell -Command "$ProgressPreference = 'SilentlyContinue'; try { $files = Get-Content '%TEMP%\repo_scripts.txt'; $results = @(); foreach ($file in $files) { if ($file -and $file -ne '' -and $file -ne 'NONE' -and $file -ne 'ERROR') { try { $url = 'https://git.weektab.org/nexus/portex/raw/branch/main/!SCRIPT_PATH!/' + $file; $content = (Invoke-WebRequest -Uri $url -UseBasicParsing).Content; if ($content -match 'REM\s*===\s*(.+?)\s*===') { $results += $file + '|' + $matches[1] } else { $results += $file + '|' } } catch { $results += $file + '|' } } }; $results | Out-File '%TEMP%\repo_titles.txt' -Encoding ASCII } catch { }" 2>nul
|
||||||
|
|
||||||
REM Display menu
|
REM Display menu
|
||||||
set INDEX=0
|
set INDEX=0
|
||||||
@@ -156,7 +156,7 @@ cls
|
|||||||
echo /// Executing: !DISPLAY[%CHOICE%]!
|
echo /// Executing: !DISPLAY[%CHOICE%]!
|
||||||
echo.
|
echo.
|
||||||
|
|
||||||
set "SCRIPT_URL=https://git.weektab.org/companas/batchr/raw/branch/main/!SCRIPT_PATH!/!SCRIPT_NAME[%CHOICE%]!"
|
set "SCRIPT_URL=https://git.weektab.org/nexus/portex/raw/branch/main/!SCRIPT_PATH!/!SCRIPT_NAME[%CHOICE%]!"
|
||||||
set "TEMP_SCRIPT=%TEMP%\batch_script_%RANDOM%.bat"
|
set "TEMP_SCRIPT=%TEMP%\batch_script_%RANDOM%.bat"
|
||||||
|
|
||||||
echo Downloading script...
|
echo Downloading script...
|
||||||
|
|||||||
Reference in New Issue
Block a user