Update launcher.bat

Убрал сортировку.
This commit is contained in:
Typikal_Failman 2025-06-10 14:42:10 +05:00 committed by GitHub
parent d34a415dda
commit e4b4ac7654
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3,49 +3,29 @@ chcp 65001 > nul
setlocal enabledelayedexpansion setlocal enabledelayedexpansion
:: Создаем временный файл для сортировки :: Создаем временный файл для сортировки
set "tempfile=%temp%\%~n0_temp.txt" :: Searching for .bat files in current folder, except files that start with "service"
if exist "%tempfile%" del "%tempfile%" echo Pick one of the options:
set "count=0"
:: Счетчик файлов
set count=0
:: Собираем файлы с приоритетной сортировкой
for %%f in (*.bat) do ( for %%f in (*.bat) do (
if /i not "%%~nxf"=="launcher.bat" ( if /i not "%%~nxf"=="launcher.bat" (
set "name=%%f" set "filename=%%~nxf"
set "sortkey=5_%%f" :: По умолчанию - группа 5
:: Определяем приоритетные группы
if /i "!name!"=="general.bat" set "sortkey=1_!name!"
if /i "!name!" neq "general.bat" (
echo "!name!" | findstr /i /c:"general (ALT" >nul && set "sortkey=2_!name!"
echo "!name!" | findstr /i /c:"general (МГТС" >nul && set "sortkey=3_!name!"
if "!sortkey:~0,1!"=="5" (
echo "!name!" | findstr /i "general" >nul && set "sortkey=4_!name!"
)
)
:: Записываем во временный файл
echo !sortkey!>>"%tempfile%"
)
)
:: Проверяем наличие файлов
if not exist "%tempfile%" (
echo В директории нет других BAT-файлов.
pause
exit /b
)
:: Сортируем и выводим список
for /f "tokens=1* delims=_" %%a in ('sort "%tempfile%"') do (
set /a count+=1 set /a count+=1
set "file!count!=%%b" echo !count!. %%f
echo [!count!] %%b set "file!count!=%%f"
)
) )
:: Удаляем временный файл :: Choosing file
del "%tempfile%" >nul 2>&1 :input
set "choice="
set /p "choice=Input file index (number): "
if "!choice!"=="" goto :eof
set "selectedFile=!file%choice%!"
if not defined selectedFile (
echo Invalid choice, try again...
goto input
)
:: Блок ввода номера :: Блок ввода номера
:input :input