             CFSocketCreateRunLoopSource(kCFAllocatorDefault, socket, 0)
         CFRunLoopAddSource(managerThreadRunLoop?._cfRunLoop, source, kCFRunLoopDefaultMode)
 
-        try command.joined(separator: " ").withCString(encodedAs: UTF16.self) { wszCommandLine in
+        try quoteWindowsCommandLine(command).withCString(encodedAs: UTF16.self) { wszCommandLine in
           try currentDirectoryURL.path.withCString(encodedAs: UTF16.self) { wszCurrentDirectory in
             try szEnvironment.withCString(encodedAs: UTF16.self) { wszEnvironment in
               if CreateProcessW(nil, UnsafeMutablePointer<WCHAR>(mutating: wszCommandLine),

    
    return true
}

open class Process: NSObject {
    private static func setup() {

        }

#if os(Windows)
        var command: [String] = [launchPath]
        if let arguments = self.arguments {
          command.append(contentsOf: arguments)
