How do I launch an EXE from Flash SWF using Action

2019-07-04 12:01发布

问题:

I want my Flash SWF to open an external EXE from the native operating system and I have tried:

protected function LaunchExe():void {
    flash.system.fscommand("exec","Test.exe");
}

But nothing happens. Am I doing something wrong with this command or do I need to something entirely differently?

回答1:

It works only from within a projector file (executable Flash), and if you are running it like that, the application you are trying to launch should be in a subdirectory called fscommand.

From Adobe:

The exec command runs in the subdirectory fscommand only. In other words, if you use the exec command to call an application, the application must reside in a subdirectory named fscommand. The exec command works only from within a Flash projector file.