code: private ProcessInfo executeProcess(boolean background,ProcessBuilder pb) 
  	{
  		try
  		{
  			
  			 pb.directory(workingDirectory);
  			 pb.redirectErrorStream(false);
  			
  			if(log != null)
  				pb.redirectOutput(Redirect.appendTo(log));
  			
  			pb.environment().putAll(envMap);
  			Process p = pb.start();
  
  			String out = null;
  			String error = null;
  			
  			if(background)
  			{
  				out = IO.readText(p.getInputStream(),true,defaultBackgroundReadSize);
  				
  				error = IO.readText(p.getErrorStream(),true,20);				
  			}
  			else
  			{
  				out = IO.readText(p.getInputStream(),true);
  				
  				error = IO.readText(p.getErrorStream(),true);	
  				
  			}
  				
    	
  			if(background)
  				return new ProcessInfo(0, out, error);
  			
  			return new ProcessInfo(p.waitFor(),out,error);
  		}
  		catch (Exception e)
  		{
  			return new ProcessInfo(-1, null, Debugger.stackTrace(e));
  		}
  	}
docs: Executes a process
  
  @param background if starting as background process
  @param pb the process builder
  @return the process information
  @throws IOException