PDA

View Full Version : getURL for .exe file


seujan
11-10-2005, 10:38 PM
I need to launch an application from within flash that lives on the C Drive.

This code works:

on(release){
getURL("file:///C:\ WINDOWS\ system32\ mstsc.exe");
}

However, once the file opens, the user has to click through a couple of screens to get to the main page. An engineer here sent me this path that works fine in the RUN prompt.

mstsc.exe /v:ortrm02 /w:640 /h:480

However, when I add the last part of the path to the getURL script like this:

on(release){
getURL("file:///C:\ WINDOWS\ system32\ mstsc.exe /v:ortrm02 /w:640 /h:480");

}

I get a "cannot find file" error message.

I appreciate your insights on this!

Seujan

palexc
11-11-2005, 12:10 AM
Your path is wrong, but even if it were right the projector's sandbox security would prevent it from loading.

Create a folder called FSCommand in the same dir as your projector. In that folder, place a .bat file that runs your mstc.exe with all the appropriate parameters. (Your engineer friend can write it for you.)

From flassh, call the following:
fscommand("exec", "batchfilename.bat");

*edit*
Fixed, forgot the 'exec' parameter.

CyanBlue
11-11-2005, 12:13 AM
Howdy and Welcome... :)

I am assuming that you are looking for a way to execute an EXE file from the Flash Projector, right???

You can find more information by searching the 'fscommand exec' from the forum or Macromedia's site so I am not going into much details, but you will need to use fscommand() function instead of getURL() function...
You cannot pass an argument when executing an EXE file for the security reason... You can get away with that by executing an BAT file that contains the argument if it is static... If the variables need to be dynamic, you can only do that by using third party projector tools such as Zinc or SWF Stuidio or mProjector...