diff --git a/lib/child_process.js b/lib/child_process.js index 3c907469bf496f..1e0dce854968b8 100644 --- a/lib/child_process.js +++ b/lib/child_process.js @@ -442,9 +442,11 @@ function normalizeSpawnArguments(file, args, options) { const command = [file].concat(args).join(' '); if (process.platform === 'win32') { - file = typeof options.shell === 'string' ? options.shell : - process.env.comspec || 'cmd.exe'; - args = ['/d', '/s', '/c', '"' + command + '"']; + if (typeof options.shell === 'string') + file = options.shell; + else + file = process.env.comspec || 'cmd.exe'; + args = ['/d', '/s', '/c', `"${command}"`]; options.windowsVerbatimArguments = true; } else { if (typeof options.shell === 'string')