diff --git a/lib/child_process.js b/lib/child_process.js index a2a576e9464967..77f02a0ed23923 100644 --- a/lib/child_process.js +++ b/lib/child_process.js @@ -440,9 +440,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')