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
parent 544893b781
commit 48de4cdc2a
+15 -12
View File
@@ -102,32 +102,35 @@ if (-not $InfoBasePath -and (-not $InfoBaseServer -or -not $InfoBaseRef)) {
exit 1
}
# --- Build arguments ---
$arguments = @("ENTERPRISE")
# --- Build arguments as single string ---
# 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) {
$arguments += "/S", "`"$InfoBaseServer/$InfoBaseRef`""
$argString += " /S `"$InfoBaseServer/$InfoBaseRef`""
} else {
$arguments += "/F", "`"$InfoBasePath`""
$argString += " /F `"$InfoBasePath`""
}
if ($UserName) { $arguments += "/N`"$UserName`"" }
if ($Password) { $arguments += "/P`"$Password`"" }
if ($UserName) { $argString += " /N`"$UserName`"" }
if ($Password) { $argString += " /P`"$Password`"" }
# --- Optional params ---
if ($Execute) {
$arguments += "/Execute", "`"$Execute`""
$argString += " /Execute `"$Execute`""
}
if ($CParam) {
$arguments += "/C", "`"$CParam`""
$argString += " /C `"$CParam`""
}
if ($URL) {
$arguments += "/URL", "`"$URL`""
$argString += " /URL `"$URL`""
}
$arguments += "/DisableStartupDialogs"
$argString += " /DisableStartupDialogs"
# --- Execute (background, no wait) ---
Write-Host "Running: 1cv8.exe $($arguments -join ' ')"
Start-Process -FilePath $V8Path -ArgumentList $arguments
Write-Host "Running: 1cv8.exe $argString"
Start-Process -FilePath $V8Path -ArgumentList $argString
Write-Host "1C:Enterprise launched" -ForegroundColor Green