Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help! Can FSCommand run .exe file?

Status
Not open for further replies.

janicefoo

Programmer
Apr 17, 2003
53
MY
Dear gurus and members.
I am a newbie in Flash and Actionscript. Hope you can share some knowledge and expertise with me. I plan to create a button on my website, using Flash & Actionscript that checks for a .txt file. If the file exists, the actionscript will call and run the software(name: one.exe), otherwise it will request user to download the software (name: soundRecording.exe). I was wondering whether is it possible if I load in the text file via the LoadVars() object, and if the file fails to load I can initiate the appropriate actions. That would go a little something like this...

myLV = new LoadVars();
myLV.onLoad = function(success){
if (success){
//If txt file loaded, calls software pop up --'one.exe'
fscommand("exec","one.exe");
} else {
//If file fails to load,displays download pop up window
//request to download software--'SoundRecorder.exe'
fscommand("exec","SoundRecorder.exe");
}
myLV.load("MyTextFile.txt");
//the .txt file to check.
}

I am concern whether is there any ways to skip the open/save dialog box? (Even if user downloaded the software/the .txt file exist on user's computer, can we eliminate the open/save dialog box?) According to a forum I read, it says that only stand-alone projector has ways to eliminate the open/save dialog box, but not for .swf that runs on a browser, is that true? How can I solve the problem?

I am not sure if this might work. Hopefully someone out there can give me some guidance and pointers. I am really at total lost and the deadline is due soon. Looking forward to some reply soon and thanks in advance.

Cheers,
Janice
 
The Flash Player is not allowed to open files on the client's hard drive, for obvious reasons.

In the same way, the Flash Player is not allowed to execute programs on the client's system, except when it is running locally, and even still, it has very stringent requirements.

Just imagine, if that worked, all sorts of malicious Flash authors could read files on your computer and download and execute harmful programs. They disallow this activity for a reason.
 
Thanks for the information. Is there any ways that I can do so? I really need to run an exe program because my e-learning website requires the specific software to perform the record/playback function. I am at total loss now. :(

Rgrds,
Janice
 
Maybe if you could elaborate on the software we could a better idea of what needs to be done.

There's always a better way. The fun is trying to find it!
 
Hi tviman,
Thanks for your reply. The software(name: one.exe) is created using MCI. User is required to install the "one.exe" in order to enable speech recording/playback. This software is a one-time installation. During the installation, it will store a .txt file onto user's computer.
One.exe has several buttons including play, record, stop and save. When user click on the button that calls this software, it will record user's speech. It also allows to playback as well as to save the .wav file on user's computer.
The button that calls this one.exe is created using Flash MX 2004. When this Flash button is clicked, it will check the user's computer for the .txt file. If it exists, it will call "one.exe". Otherwise, it will call "SoundRecorder.exe" that is on the server to download and install "one.exe". I plan to use actionscript to check for the existing .txt, but now, I am stuck here as there is no ways I can continue :(
Hope my explanation is not confusing. Looking forward to your reply soon.

Thanks in advance,
Janice
 
I think the only way this is going to work is if the user associates whatever file one.exe is supposed to play. Bear in mind that the file association is universal on the users machine. In other words, if the file to be played is a .txt file, then EVERY .txt file on the user's machine will try to use one.exe. Additionally, your users would have to install one.exe in the EXACT SAME directory - something that you just can't guarantee.

I think that you might want to try looking for some other solutions.

There's always a better way. The fun is trying to find it!
 
Hi tviman,
Thanks for your suggestions. I was hoping to change the .exe into .ocx. The new solution is as follow, but I am still unsure if it works. Hope you can share some ideas and expertise with me.
User is not required to install one.exe. I change it to .ocx. There will be no more SoundRecord.exe. This .ocx is stored on the server. Whenever user clicks on the Flash button, the actionscript will call VBScript that calls this .ocx file. The .ocx file records and playbacks the user's speech. It will also save the .wav file onto user's computer (client side). One thing I am very much concern is, by doing so, it might cause Active X and other security dialog boxes to pop up. This is because I am saving something onto client side from the server(.ocx). Is there any ways to skip all these pop ups? I don't plan to purchase digital certificate for this as I am still a student doing my honors projects.
Any suggestions or ideas are highly appreciated. Sincerely looking forward to your reply soon.

Thanks in advance,
Janice
 
Some things to consider...

There's no way to stop the ActiveX security pop-up. ActiveX modules have, and continue to be, a path that some hackers use to transport viruses/worms to other computers.

Use of ActiveX modules and controls works only with Internet Explorer browsers so you're limiting your user scope.

Browsers can't maintain asychronis connections to the server so the user will have to record the voice file, save it on their local machine, then upload it to the server. The only way around this would be to create an application that works independantly of the browser but it will be necessary for the user to download it to their machine.

Good luck...

There's always a better way. The fun is trying to find it!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top