From 874b6813a83f009947934a77a14a7ae6acacb3ea Mon Sep 17 00:00:00 2001 From: Matvey Beloded Date: Mon, 12 Jan 2026 23:44:26 +0700 Subject: [PATCH] Fixed output of `.bat` file list (#9027) --- service.bat | 2 +- utils/test zapret.ps1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/service.bat b/service.bat index 1ffaca8..c0e574d 100644 --- a/service.bat +++ b/service.bat @@ -203,7 +203,7 @@ set "LISTS_PATH=%~dp0lists\" :: Searching for .bat files in current folder, except files that start with "service" echo Pick one of the options: set "count=0" -for /f "delims=" %%F in ('powershell -Command "Get-ChildItem -Filter '*.bat' | Where-Object { $_.Name -notlike 'service*' } | Sort-Object { [Regex]::Replace($_.Name, '\d+', { $args[0].Value.PadLeft(8, '0') }) } | ForEach-Object { $_.Name }"') do ( +for /f "delims=" %%F in ('powershell -NoProfile -Command "Get-ChildItem -LiteralPath '.' -Filter '*.bat' | Where-Object { $_.Name -notlike 'service*' } | Sort-Object { [Regex]::Replace($_.Name, '(\d+)', { $args[0].Value.PadLeft(8, '0') }) } | ForEach-Object { $_.Name }"') do ( set /a count+=1 echo !count!. %%F set "file!count!=%%F" diff --git a/utils/test zapret.ps1 b/utils/test zapret.ps1 index 6bad354..bdb7c30 100644 --- a/utils/test zapret.ps1 +++ b/utils/test zapret.ps1 @@ -384,7 +384,7 @@ $dpiTargets = Build-DpiTargets -CustomUrl $dpiCustomUrl # Config $targetDir = $rootDir if (-not $targetDir) { $targetDir = Split-Path -Parent $MyInvocation.MyCommand.Path } -$batFiles = Get-ChildItem -Path $targetDir -Filter "*.bat" | Where-Object { $_.Name -notlike "service*" } | Sort-Object { [Regex]::Replace($_.Name, "\d+", { $args[0].Value.PadLeft(8, "0") }) } +$batFiles = Get-ChildItem -Path $targetDir -Filter "*.bat" | Where-Object { $_.Name -notlike "service*" } | Sort-Object { [Regex]::Replace($_.Name, "(\d+)", { $args[0].Value.PadLeft(8, "0") }) } $globalResults = @()