Здравствуйте
У меня есть задача вот такой вот командой в shell (print /p:COM1 D:\test.txt) запустить печать
Мой код:

Код AS3:
var file:File = File.applicationDirectory.resolvePath("D://test.txt");
var cmd:File = new File("C:\\WINDOWS\\system32\\cmd.exe");
var stream:FileStream = new FileStream();
stream.openAsync(file, FileMode.WRITE);
var str:String="Заявление номер "+Math.round(Math.random()*10000)+" успешно зарегистрировано";
stream.writeUTFBytes(str);
stream.close();
trace(file.nativePath);
//print /p:COM1 [путь и имя файла]
nativeProcess = new NativeProcess();
var printStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
var args:Vector.<String> = new Vector.<String>();
args.push("/c", ('print /p:COM1 '+file.nativePath));
//args.push("print /p:COM1 "+file.nativePath);
trace(args);
printStartupInfo.arguments = args;
printStartupInfo.executable=cmd;
nativeProcess.addEventListener(NativeProcessExitEvent.EXIT, onExit);
//nativeProcess.addEventListener(Event.STANDARD_ERROR_CLOSE, standardErrorClose);
//nativeProcess.addEventListener(ProgressEvent.STANDARD_ERROR_DATA, onErrorData);
//nativeProcess.addEventListener(IOErrorEvent.STANDARD_ERROR_IO_ERROR, onIOError);
nativeProcess.addEventListener(Event.STANDARD_INPUT_CLOSE, standardInputClose);
nativeProcess.addEventListener(IOErrorEvent.STANDARD_INPUT_IO_ERROR, onIOError);
nativeProcess.addEventListener(ProgressEvent.STANDARD_INPUT_PROGRESS, standardInputProgress);
nativeProcess.addEventListener(Event.STANDARD_OUTPUT_CLOSE, standardOutpoutClose);
nativeProcess.addEventListener(ProgressEvent.STANDARD_OUTPUT_DATA, onOutputData);
nativeProcess.addEventListener(IOErrorEvent.STANDARD_OUTPUT_IO_ERROR, onIOError);
nativeProcess.start(printStartupInfo);
На печать не уходит файл
Что я неправильно делаю ?