Skip to main content
Inspiring
January 19, 2017
Question

Windows PowerShell and NativeProcess

  • January 19, 2017
  • 0 replies
  • 390 views

hello,

Windows PowerShell and NativeProcess work on Windows 10 but not on Windows 7

var nativeProcess:NativeProcess = new NativeProcess();

var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();

var file:File = new File("C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe");

nativeProcessStartupInfo.executable = file;

//nativeProcess.addEventListener(IOErrorEvent.STANDARD_INPUT_IO_ERROR, onIOError);

nativeProcess.start(nativeProcessStartupInfo);

nativeProcess.standardInput.writeUTFBytes('[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")' + "\n");

nativeProcess.standardInput.writeUTFBytes('[System.Windows.Forms.MessageBox]::Show("We are proceeding with next step.")' + "\n");

on Windows 7

nativeProcess.standardInput.writeUTFBytes();

not work but

nativeProcess.addEventListener(IOErrorEvent.STANDARD_INPUT_IO_ERROR, onIOError);

not dispatch event

Thanks

This topic has been closed for replies.