tags:

views:

20

answers:

1
import flash.desktop.NativeProcess;
import flash.desktop.NativeProcessStartupInfo;

if (NativeProcess.isSupported) {
    var npsi:NativeProcessStartupInfo = new NativeProcessStartupInfo();
    var processpath:File = File.applicationDirectory.resolvePath("MyApplication.whatever");
    var process:NativeProcess = new NativeProcess();

    npsi.executable = processpath;
    process.start(npsi);
}

The above can only run a sub-application, but how to run an independent application(command) like ipconfig and get the result?

A: 

I don't think you can, it's a self-impossed limitation of the NativeProcess API. However, you can create a little Windows binary yourself that calls ipconfig and passes the information back to the AIR app.

If creating that binary seems like a big deal, take a look to haXe and xCross, you can get it done with a fairly similar language to ActionScript.

HTH,

Juan

Zárate

related questions