10 Replies Latest reply: Jun 24, 2015 5:28 AM by janfw RSS

    NativeProcess fails if args contain spaces

    mraak Community Member
      Following code works just fine, and outputs 'blah' to stdout. 
      However, if I put this arg

      args.push("blah blah");

      It fails totaly. What I get on the stdout is corrupt 
      path to helloworld.bat, although it has nothing to do with 
      specifying that path.

      var args:Vector.<String> = new Vector.<String>;

      if (Capabilities.os.toLowerCase().indexOf("win") > -1)
        fPath = "C:\\Windows\\System32\\cmd.exe";
      file = new File(fPath);
      var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
      nativeProcessStartupInfo.executable = file;                     
      nativeProcessStartupInfo.arguments = args;
      process = new NativeProcess();