I agree with abudaan, you do not need closeInput() .
Also, suggest adding a line break at the end of the writeUTFBytes () call, for example:
NP.standardInput.writeUTFBytes("start C:\\Windows\\System32\\rundll32.exe shell32.dll,Control_RunDLL hotplug.dll **\n**");
Finally, I recommend that you listen to other events in NativeProcess, I use a block of code like this:
NP.addEventListener(ProgressEvent.STANDARD_OUTPUT_DATA, onStdOutData); NP.addEventListener(ProgressEvent.STANDARD_ERROR_DATA, onStdErrData); NP.addEventListener(Event.STANDARD_OUTPUT_CLOSE, onStdOutClose); NP.addEventListener(ProgressEvent.STANDARD_INPUT_PROGRESS, onStdInputProgress); NP.addEventListener(IOErrorEvent.STANDARD_ERROR_IO_ERROR, onIOError); NP.addEventListener(IOErrorEvent.STANDARD_INPUT_IO_ERROR, onIOError); NP.addEventListener(IOErrorEvent.STANDARD_OUTPUT_IO_ERROR, onIOError);
with normal event handler functions that at least keep track of what they get.
Good luck. I spent several hours developing NativeProcess with cmd.exe - this is vague. But I got there at the end, and so did you.
source share