diff --git a/src/shared/child-process/windows-command-line.ts b/src/shared/child-process/windows-command-line.ts index 401141e36c7..e3402f93c19 100644 --- a/src/shared/child-process/windows-command-line.ts +++ b/src/shared/child-process/windows-command-line.ts @@ -32,6 +32,9 @@ * because that part `CommandLineToArgvW` does interpret. */ function quoteWindows(value: string, escapePercent: boolean): string { + if (!(escapePercent ? /[\\"%]/ : /[\\"]/).test(value)) { + return `"${value}"` + } let quoted = '"' let backslashes = 0 for (const char of value) {