fix(db-run): use single-string ArgumentList for Cyrillic /Execute paths

Start-Process without -NoNewWindow uses ShellExecute API which corrupts
Cyrillic characters when ArgumentList is passed as an array. Switching
to a single concatenated string fixes file-not-found errors for paths
like МояОбработка.epf.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Nick Shirokov
2026-02-16 20:15:20 +03:00
co-authored by Claude Opus 4.6
parent 544893b781
commit 48de4cdc2a
+15 -12
View File
@@ -102,32 +102,35 @@ if (-not $InfoBasePath -and (-not $InfoBaseServer -or -not $InfoBaseRef)) {
exit 1 exit 1
} }
# --- Build arguments --- # --- Build arguments as single string ---
$arguments = @("ENTERPRISE") # Note: Start-Process without -NoNewWindow uses ShellExecute.
# Passing ArgumentList as array can corrupt Cyrillic when ShellExecute
# re-joins elements. Single string avoids this.
$argString = "ENTERPRISE"
if ($InfoBaseServer -and $InfoBaseRef) { if ($InfoBaseServer -and $InfoBaseRef) {
$arguments += "/S", "`"$InfoBaseServer/$InfoBaseRef`"" $argString += " /S `"$InfoBaseServer/$InfoBaseRef`""
} else { } else {
$arguments += "/F", "`"$InfoBasePath`"" $argString += " /F `"$InfoBasePath`""
} }
if ($UserName) { $arguments += "/N`"$UserName`"" } if ($UserName) { $argString += " /N`"$UserName`"" }
if ($Password) { $arguments += "/P`"$Password`"" } if ($Password) { $argString += " /P`"$Password`"" }
# --- Optional params --- # --- Optional params ---
if ($Execute) { if ($Execute) {
$arguments += "/Execute", "`"$Execute`"" $argString += " /Execute `"$Execute`""
} }
if ($CParam) { if ($CParam) {
$arguments += "/C", "`"$CParam`"" $argString += " /C `"$CParam`""
} }
if ($URL) { if ($URL) {
$arguments += "/URL", "`"$URL`"" $argString += " /URL `"$URL`""
} }
$arguments += "/DisableStartupDialogs" $argString += " /DisableStartupDialogs"
# --- Execute (background, no wait) --- # --- Execute (background, no wait) ---
Write-Host "Running: 1cv8.exe $($arguments -join ' ')" Write-Host "Running: 1cv8.exe $argString"
Start-Process -FilePath $V8Path -ArgumentList $arguments Start-Process -FilePath $V8Path -ArgumentList $argString
Write-Host "1C:Enterprise launched" -ForegroundColor Green Write-Host "1C:Enterprise launched" -ForegroundColor Green