Conquering FSCommand EXEC Part 1 : Proxy
 Posted on Tue Aug 7 2007 in Tools by Tim

A typical requirement you'll run across when developing CD based Flash projects is the need to open documents from your Flash projector. You can use getURL to open most documents, but sometimes the document opens behind the projector. The EXEC fscommand could be used to launch a helper application, but unfortunately the EXEC fscommand doesn't allow you to pass parameters to external applications so you have no way to tell the outside world which file you want to open.

You can thank the creators of the first Flash virus (SWF/LFM-926) for the fact that every version of the stand-alone Flash player since Flash MX has restricted the use of the EXEC command. This change made it impossible for anyone to create any new Flash based viruses, but it also crippled the Flash projector as a tool for legitimate users by instantly rendering many free projector extension tools useless.

There are four key restrictions that you have to keep in mind when working with the EXEC fscommand and standalone Flash projectors. (i) Executables you want to run via the EXEC fscommand have to be in a special sandboxed folder called fscommand in the same directory as the projector. (ii) You can't specify a path in the EXEC command, just a filename. If the specified file is not found in the fscommand folder, it won't run. (iii) The only argument allowed by the EXEC fscommand is a filename, there is no way to pass arguments to the executables that you want to run. (iv) You can't use EXEC from an SWF file, it will only work from a projector (EXE). The last restriction doesn't really concern us, but if you're trying to test your EXEC calls, being aware of it will save you some frustration.

Update One additional restriction you will have to deal with is the fact that Flash 9 projectors can't launch BAT files on Windows 2000, XP and Vista.

Important If you use SWF Studio then you don't need to read any further. SWF Studio still supports the Flash EXEC FSCommand but the limitations have been removed. Your SWF Studio projectors will be able to pass arguments to external applications and you won't have to put the executables you want to run in the fscommand sandbox folder. SWF Studio extends Flash with new commands like ssCore.Shell.execute and ssCore.Shell.open that make the EXEC fscommand obsolete and give you an unprecedented amount of control over your external applications and documents.

One solution to get around the limitations of the EXEC fscommand is to create one exectuable file for each file that you want to open, but what can you do if you don't know how to make EXE files? Windows and Flash both consider a BAT file as an executable file so the easy solution is to create a BAT file for each file you want to open and EXEC the BAT file from Flash. You don't need to be a BAT file wizard to do this, the simple one-liner below (let's call it mydoc.bat) will do the trick:

start mydoc.pdf

That example assumes that both mydoc.bat and mydoc.pdf are in the fscommand folder. You can change the BAT file to launch the PDF file from anywhere you like, as long as you can create a valid path to the file. Now all you have to do is create a BAT file for every file you want to open and call it from Flash like this:

fscommand("exec", "mydoc.bat");

The only problem with this approach is that your user is going to see the ugly black DOS box appear every time they open a file. That's where the proxy utility can help you create a more professional looking end product for your users. Proxy is able to launch BAT files and suppress the ugly DOS box.

usage: proxy.exe

When you run the proxy utility, the first thing it does is look at its own name, in this case proxy.exe. It then looks for a BAT file in the same directory with the same base name, i.e. proxy.bat, and runs that BAT file. If you rename the proxy utility to xyz.exe then the utility will look for and try to run xyz.bat. If a BAT file with the same name can't be found, proxy will just fail silently.

By making copies of proxy.exe with different names and creating multiple BAT files you can run as many "hidden" BAT files as you need, neatly sidestepping the Flash limitation on passing parameters to external applications.

Here are step by step instructions to use the proxy utility to open a PDF file without the ugly DOS box.

Create a BAT file called file1.bat that contains just the following line. This is a plain text file that you can create with notepad or your favorite text editor.

start file1.pdf

Put the BAT file in a folder called fscommand along with a copy of proxy.exe.

Rename the copy of proxy.exe to file1.exe (same base name as the BAT file you created).

Place your PDF document (called file1.pdf) in the fscommand folder with the BAT and EXE files. You don't have to store the files you want to open in the fscommand folder, but for your first test this makes things easier.

Add the following command to your FLA where you want to open the PDF document (probably on a button release action).

fscommand("exec", "file1.exe");

Now put your Flash EXE and the fscommand folder on your desktop and run the Flash EXE. When the EXEC command is called your PDF document should open.

The example.zip contains the source for a simple Flash MX projector (projector.fla), a compiled version of the projector (projector.exe) and an fscommand folder with a copy of the proxy utility (renamed to test.exe), the BAT file that the proxy utility will launch (test.bat) and a PDF file (test.pdf) that will be opened when the BAT file is run. Download the example to see the proxy utility in action.



Version: 3.1
Released: March 30, 2009
Download: proxy.exe (52KB)

This utility has been around for many years now and the Standalone and Applications forum that I moderate at FlashKit is home to a few long running discussions about problems other people have encountered and how the proxy utility has helped them. Definitely worth a read.

Discuss

Visit our Discussion Forums to talk about any of Northcode's tools. It's FREE to join and a great source of information for professional Flash application developers.

Comments

Hi ! Many thanks for your .exe. You saved me! I coudn't fix this fp9 projector problem with fscommand exec.

Best regards

Jerome
Posted by Jerome Labarbe on 30 Aug 2007 at 11:52am
YOU ARE MY IDOL

i was really frustrated untill i reach your blog, now my demo disc run perfectly thank you very mucho
Posted by Demonh8 on 5 Sep 2007 at 5:18pm
If it wasn't for people like you, we would scratch the walls with frustration whenever a company like Adobe screwed something up :)

Keep up the great work!
Posted by Peter Kalman on 10 Sep 2007 at 7:52am
You are a life saver !!!

I owe you my life. Nothing like waiting until the night before to test an extremely important part of the project. I would have paid a lot of money for that. Thank you, thank you, thank you.

"Sir here is a check with my name on it, write any amount on it and I will pay it " -Peter Griffin
Posted by Daniel Smith on 13 Sep 2007 at 11:46pm
Thanks, thanks....From me (the developer), my magazine director and all our readers.
Posted by Carlos López-Plandolit on 14 Sep 2007 at 9:24am
Maybe the only document to get over this annoying limitations.
Great instructions mate, thanx a bunch!
Posted by Seyfi Cem Baskýn on 17 Sep 2007 at 5:17am
What do you want ?, just name it. You saved my bacon on a very important job I have been struggling with. Thank You.
Posted by Andrew Keet on 17 Sep 2007 at 2:30pm
Agreed. This is an awesome script you have compiled. This has definitely saved my hide as well in creating a hybrid CD. Thank You! does not seem enough.

... and the link to the forum has helped a lot with issues I ran into.
Posted by Amy on 18 Sep 2007 at 12:27pm
Thanx man ur job is great! long life with scripting and saving ppl ;)

cheers
Posted by Paco on 19 Sep 2007 at 4:30am
You have no idea how grateful i am... you exes really helped me with that presentation...
Thanks a lot
Posted by verdesoto on 27 Sep 2007 at 5:13pm
THANK YOU!!!!! THANK YOU!!!!! THANK YOU!!!!! THANK YOU!!!!! THANK YOU!!!!! THANK YOU!!!!! THANK YOU!!!!! THANK YOU!!!!! THANK YOU!!!!! THANK YOU!!!!! THANK YOU!!!!! THANK YOU!!!!! THANK YOU!!!!!
Posted by Tom on 4 Oct 2007 at 10:40pm
Excelente! No más problemas. Gracias amigo!
Posted by Bambino on 9 Oct 2007 at 6:26pm
Dude, i think i love u!
Posted by David on 13 Oct 2007 at 1:30am
Thanks for this awesome tutorial you ROCK
Posted by The Designer on 15 Oct 2007 at 3:34pm
super duper dooooo!!

agr8 man! you did it
Posted by Muthu on 25 Oct 2007 at 4:35am
Such an annoying problem in the first place... Thank you so much for providing a solution!
Posted by Kayvan on 25 Oct 2007 at 10:48am
HELL YES! I'd love to buy you a beer, or whatever your drink of choice. I had a CD project going out today and my external files werent working. This saved my butt!
Posted by Josh on 29 Oct 2007 at 5:03pm
I will be eternally grateful!!! THANKS!!! Salú!!
Posted by marisa on 31 Oct 2007 at 6:43pm
OH MY GOD!
I´m From Brasil, and i was searching how to open pdf in .exe, then I saw: It doesn´t works in CS3!
Then I enter here and there it is!!

THANK YOU! You ROCK!You Save me!

Best Regards!!!
Posted by Beno Netto on 2 Nov 2007 at 7:42pm
you have saved my insanity!!
Posted by Kirsty on 5 Nov 2007 at 9:34am
you beauty! this has taken me all day to find!!!
Posted by Mark on 9 Nov 2007 at 9:05am
waaahhh! you're my saviour! i wanna cry with happiness!! thanx a lot!!
Posted by noahvearn on 11 Nov 2007 at 9:33pm
thanks man. all the people who wrote before me are right... many, many, THHHHHAAAAAAAAAANNNNNNNNKKKKKKKKSSSSSSSSSS!!!!
Posted by Manuel on 12 Nov 2007 at 4:24pm
Thank you so much, this saved my bacon big time.
Posted by Angus on 13 Nov 2007 at 7:25am
I love you as much as a heterosexual man can love another man.

Thanks!!
Posted by Noah on 14 Nov 2007 at 12:27pm
You are amazing!!!
Posted by Richard Freudenfeld on 19 Nov 2007 at 11:48am
You bailed me out on this one. Was beating my head against the wall so long that when it actually worked -- and so well -- I was amazed.
Posted by Calhoon on 21 Nov 2007 at 4:21pm
THANK YOU VERY VERY MUCH...

YOU SAVE MY LIFE ....

THANK YOU
Posted by Fawn (from Thailand) on 1 Dec 2007 at 12:39pm
excellent .....thanks for example.zip

thank a lot...!
Posted by samir panchal on 8 Dec 2007 at 6:06am
THANKS
Today is my deadline, and finally I find your blog with this GLORIOUS PROXY!!!! You just save my life.
THANKS
Posted by JuanM on 19 Dec 2007 at 6:59am
I cant thank you enough. The script works a treat and gets round the annoying problem of CS3 projectors not opening bat files properly.
Posted by David Jenkins on 1 Jan 2008 at 10:26am
Like everyone else on here...i would like to express my thanks for your help and solution...
Posted by Owen Hardy on 16 Jan 2008 at 10:57am
The 737th Training Support Squadron of the United States Air Force thanks you. All of the Visual Presentations used in the USAF Basic Training Acedimic classes are built and delivered via Flash Projector Files. These files are accessed through a Master Menu (also a Flash Projector file).

Most of the lessons incorporate video utlizing the media component, and when we moved to CS3, none of our videos would launch "if" the Lesson Presentation projector file was launched from the Main Menu projector file.

We do updates continually making this a serious problem, and Adobe essentially tried to tell us it was our fault.

So thank you very much.
Posted by Dave Terry on 16 Jan 2008 at 2:49pm
I just created my first CD-ROM based presentation with a Flash based EXE homepage that links to PDFs and Word docs. I was not aware of the getURL issue because the links worked fine on my PC. But when the client reviewed the project, they recieved all kinds of IE "Security Warning" messages because, as you know, the PDFs opened within IE and not the actual application and not to mention that the browser opened behind the projector file. I came across your wonderful "Proxy" solution in a Flashkit forum after 3 days of just trying to figure-out an ActionScript solution. Needless to say, that was hopeless.

So here I am, very relieved and happy. More importantly the client is happy and I can't thank you enough. THANK YOU, THANK YOU, THANK YOU!

Sincerely,

Will
Posted by Will Cruz on 25 Jan 2008 at 1:57pm
Thank you so much!
Posted by Valdemar De Matos on 1 Feb 2008 at 5:18am
Thanks! I am so glad this is here, becuase I scoured the web looking for a solution. I thought it was something I was doing wrong, nope just Adobe.
Posted by Jen Z on 5 Feb 2008 at 10:39pm
Thank you! This has saved my project from the grave!
Posted by Chris Burden on 6 Feb 2008 at 6:38pm
5 AM GMT +1, four hours of searching and finally i got it. THANK YOU. omg i can finally go sleep..
Posted by Jose Francisco De la Rua on 6 Feb 2008 at 11:06pm
THX A LOT !!! - Really Usefull
Posted by Tommy on 14 Feb 2008 at 4:06pm
It's so rare to find a Flash fix that works instantly, well done. Clear, concise instructions, and a perfect workaround.
Cheers!
Posted by Kim on 3 Mar 2008 at 5:39am
Thank you! This tutorial really very useful.
Posted by Amol on 4 Mar 2008 at 4:09am
dude! you're awesome!!
Posted by tina on 4 Mar 2008 at 12:15pm
thank you! your tutorial save me !
Posted by yuhei on 5 Mar 2008 at 6:49am
Many thanks! After hours of googling finally someone who explained, what the problem is (WAS!) and then also the solution!!! You're awesome, man!
Posted by chris on 6 Mar 2008 at 8:57am
It's working great ... thanks a lot!
Posted by Vince on 20 Mar 2008 at 10:52am
Excellent, thank’s from Costa Rica!!!
:)
Posted by Cristian on 27 Mar 2008 at 11:56am
AAAAHH!

I WONT GET FIRED!!

while(i<1000){
i++;
print("Thank you!!!");
}
Posted by MilanGM on 28 Mar 2008 at 10:22am
You saved my butt. Thanks a million!
Posted by Joe W on 2 Apr 2008 at 1:27am
thanks a lot! you solved my problem, thanks to people like you that dedicate a time to help when companies just leave us in the darkness. If wasn't for your article I could of been spending weeks trying to find out why it is not working, probably would end reinstalling version 4 or something, but your solution is much better, looks more professional!
Posted by abk on 3 Apr 2008 at 3:18pm
U saved my life :) Thank You !!!!!!!!!!!!!!!!!!!!!!!
Posted by DVDavy on 6 Apr 2008 at 8:39am
Eternal thanks, man! That's really awesome!!!
Posted by Michal Kuba on 13 Apr 2008 at 3:47pm
You have no idea of the struggle i had trying to open external video files with fscommand!!!!

You're a genius, thank's
Posted by Julian Perez on 14 Apr 2008 at 3:37pm
Excellent solution, you saved my live today!!
Posted by Maciek W on 22 Apr 2008 at 10:06am
thankyou soooo much
Posted by dave on 29 Apr 2008 at 8:15am
ThankS! You have saved my project!

:X
Posted by Stankiewicz on 1 May 2008 at 8:08am
txnx
Posted by mario on 2 May 2008 at 10:34am
AWESOME!!
Posted by TJ on 4 May 2008 at 1:08pm
Thanks for the updated tool. works like a champ.

You are KING!

Posted by BD72 on 9 May 2008 at 10:42am
thank you very much for your help!
Posted by pereda on 9 May 2008 at 7:39pm
Save my project too...tk
Posted by radu on 14 May 2008 at 3:55am
THANKS A LOT
Posted by ravindar on 15 May 2008 at 10:53am
Here in South Africa, in 2010, we will have a soccer world cup. I hereby offer you a free accommodation with electricity and water included.

Ndiyabulela kakhulu mhlekazi wam!!!!
Posted by Fezile Mlungu on 16 May 2008 at 9:07am
u da man
Posted by cup on 21 May 2008 at 2:59am
Just need to put another drop in the bucket. You really saved my project. (Deadline was tomorrow and I had NO idea that CS3/Flash9 was going to do this to me)
Posted by Fen on 25 May 2008 at 3:58pm
Another message of eternal gratitude!
Adobe should pay you every time someone comes across this problem and discovers your page!
Many many thanks.
Posted by grateful on 29 May 2008 at 6:15pm
Wow, it's amazing. You're really helping me out from this nightmare. Thank you so much!
Posted by madif on 30 May 2008 at 8:25pm
hi
I'm a beginner in flash but i'm a vb.net programmer and i always wanted to start a process from flash using fscommand, but it wasn't working.now that you've made this possible i thank you very much both for educating me and making me more interested in learning flash.

Posted by Mohsen on 1 Jun 2008 at 3:22am
this is really great...
Now I can make the CD structure as I want...
with the use of .bat .... the whole thing has become very flexible..

Thanks for the help...
Posted by Pratik on 2 Jun 2008 at 10:02am
This is really greaaaaaaaaat
ThanksThanksThanks...Thanks
Posted by Abdullah on 4 Jun 2008 at 2:27pm
The Answer To Life Universe And Everything...42...no...I mean...proxy.exe!
Posted by daniel on 5 Jun 2008 at 7:22am
I'll have to say, you solution works even better than expected. I was using another solution that opened PDFs just fine but when it came to opening video files, it just couldn't handle it (I think a Windows Media update had something to do with that). What's even better, the videos come up instantly versus the 3-5 second delay I was seeing. Thank you so much.
Posted by Dave Ramsey on 21 Jul 2008 at 9:51am
WOW

youre awesome dude!

btw the proxy.exe is not a harmful program right? :D :D :D
Posted by hadi on 22 Jul 2008 at 2:20am
If you got your copy of proxy from our site, it's safe and does only what the documentation says it does.
Posted by Tim on 22 Jul 2008 at 2:26am
Great Script. It saved my day.
Posted by Creationpool - Flash Agentur Berlin on 28 Jul 2008 at 7:40pm
AWEEEESOME man, you saved me today, i was fighting a deadline trying to run my c# application from flash, my application crashed on startup with ArgumentException not handled!

Thanks again. :)
Posted by eddiE on 30 Jul 2008 at 9:04am
Thaaaaaaaaaaaaaaaaaaaanx man alot

you give us a good help with this

:)
Posted by Ala on 31 Jul 2008 at 6:13am
Is the source code available for proxy.exe? We have a project where the client wants to see the command window while the batch file is running.
Posted by Brian on 31 Jul 2008 at 3:48pm
Normally I would have said "just call the BAT file directly", but the issue with CS3 not calling BAT files properly takes that option off the table. The source for proxy is not available, but I just emailed you a custom version of proxy that does what you need.
Posted by Tim on 31 Jul 2008 at 4:26pm
hatur nuhun
-thanx in sundanesse-
Posted by wdy on 7 Aug 2008 at 1:28pm
What if I only need to open a folder, not a file...?
Posted by edger on 12 Aug 2008 at 5:55pm
You can call explorer.exe in the BAT file to open the folder you want. For example

explorer.exe "c:\documents and settings"
Posted by tim on 12 Aug 2008 at 6:10pm
Thank you so much it works really well!
Posted by Stephan Stroh on 19 Aug 2008 at 8:09am
Hi, I'm not sure if this is even possible... here goes:

I have two .exe files that I want to open. One is the French version and one is the English version of the same player (.exe) file.

I would like to have two buttons in my main projector file, one to open the French .exe and one to open the English .exe.

Is there a way to do this?
Posted by Mary on 19 Aug 2008 at 12:21pm
Sure, you can use System.capabilities.language to find out what language the system is running and choose the EXE you want automatically OR you can just hard code the EXEC command for each button to call opene.exe and openf.exe (or whatever you want to call them)
Posted by Tim on 19 Aug 2008 at 12:56pm
This works for me to launch a pdf in Win2k/XP/Vista. However, it is *not* working for me to launch a .exe file in Vista. I am using Flash CS3.
Posted by Chris on 19 Aug 2008 at 4:42pm
What is the name of the EXE file you are trying to launch? Does the EXE have a "shield" on the icon?

Vista makes some assumptions about what you're trying to do based on the name of the EXE. If you have the "setup", "install" (or a few others) in the file name, Vista thinks those apps should have admin rights and when you try to launch them as a normal user they will fail. The shield on the icon is the clue that Vista thinks the application might need more rights

You could also be running into the problem using the start command in Vista that I describe in this post: Fixing the Windows Start Command in Vista.
Posted by Tim on 19 Aug 2008 at 5:42pm
Great job! Will it work for opering .app-files on mac also? Guess I'll just have to try...brb
Posted by David on 21 Aug 2008 at 11:26am
Crap. It won't work for mac. Any ideas for a solution there? Thanks
Posted by David on 21 Aug 2008 at 11:53am
I know the problem exists on the Mac too, but I'm not sure if it's the same problem or not. I haven't put a lot of work into investigating that side. I've been getting a few requests though, so I might have to do something soon.
Posted by Tim on 21 Aug 2008 at 12:26pm
thanks very much man
it's me pleasant to be one of your fans
thanks a lot
Posted by creativity lover on 27 Aug 2008 at 10:56am
THANK YOU!! Like all the previous comments, you have saved me sooooo much time, frustration and not to mention my job too!! . . . My project is finally finished!!!

THANK YOU again!
Posted by Raphaelle Wilson on 27 Aug 2008 at 11:34pm
YOU ARE A GENIUS!
Posted by paul on 2 Sep 2008 at 7:05am
Pulled me out of a hole - thanks very much indeed. Works brilliantly.
Posted by Will Burrows on 8 Sep 2008 at 5:14am
Brilliant. Thank you very very much!
Posted by Omar on 14 Sep 2008 at 9:52pm
Hi,

Nice stuff...very useful.
Posted by jasvinder singh on 16 Sep 2008 at 10:24am
Thanks a lot. You are GOD.
Posted by flasherKEN on 18 Sep 2008 at 2:44am
you can place your desktop shortcuts in the folder and call them with the .LNK extension......

Exactly what i was looking for.
Im making a flash program that runs apps instead of having loads of shortcuts on my desktop i can have them in a nice flash prog.

Just like a sidebar in vista but with your own design..

Thanks
Posted by Hyp3r on 20 Sep 2008 at 5:49pm
thanks, thanks thansk thanks,thanks so much!!!!!! My heart beats again!!!
Posted by Ruben on 23 Sep 2008 at 4:42am
hey super!

thanks a lot !!!!!! that's really a tutorial - should be on first place when googling for fscommand/exec

Thank You.
Posted by genesis-upanishad on 23 Sep 2008 at 5:03pm
Oh GOD

I and my brother work about one week in a Multimedia CD project. when it was in end we knew that The .EXE of project can't open files that was in "fscommand" folder!!!!!!!!! in a shame error!!

this was end of interesting when i found Your blog...
thank you so much and if i can help you please welcome to me.

Best Regards

Reza Amya & Saeid Amya
Brothers Design
Posted by Reza Amya on 25 Sep 2008 at 9:06am
Thank you so very much, I can sleep tonight... God bless you...
Posted by Heidi on 27 Sep 2008 at 7:13am
This thing with fscommand and Vista was driving me crazy today. Thanks to this post all is ok now and IT WORKS! I'm very grateful. Thank you :)
Posted by zamrai on 2 Oct 2008 at 3:28pm
Hello,
I am creating a CD rom.
I have created a flash.exe file with fscommand folder inside there's a .bat file + .exe file + .pdf all have the same file name.
Problem the file name is called:
ICS telecom v9 - install instructions.pdf and it cannot be name changed note there is spaces between characters and a hyphen whichdoes not work. Can I create a variable for that file name as in the future the file name will change ie not v9 but v10 I am not sure what to do next, please help...thanks
Posted by sandra wilson on 8 Oct 2008 at 9:36am
You can call the bat file and the exe file anything you like. Choose something simple without spaces or special characters. Inside the BAT file you can call the PDF by it's real name, and use quotes around the filename if you have to. You just have to remember what EXE file to call in your FLA to open the right PDF file.
Posted by Tim on 9 Oct 2008 at 2:13pm
hi, i have this shameful error !!!

very so much thank you, GOD FLASH MAN !
Posted by saiednt on 13 Oct 2008 at 9:42pm
You've just helped another fella out of a sticky situation - how generous of you to share this with everyone - did the whole copy2/proxy.exe trick - worked a treat - thankyou!!!!!!!!
Posted by Ian on 31 Oct 2008 at 12:11pm
mr. google has brought me 2 this incredible post and one of my worst problems has finally disappeared! thank you for sharing this with the whole flash community.
Posted by vinicius on 7 Nov 2008 at 2:54pm
This is incredibly useful information! Thank you!
Posted by Rowan on 10 Nov 2008 at 5:36am
Hey Man,
You are a ture life saver... I LOVE YOU!
Posted by Ammar on 12 Nov 2008 at 7:10am
Thanks so much for helping me meet my deadline of this afternoon! Fixed my problem in no time!
Posted by Andrea on 21 Nov 2008 at 7:38am
You just saved me from a serious headache !,I dont care much about the proxy.exe file .. but lunching from the bat is a life saver!
Posted by Raymond on 25 Nov 2008 at 11:57am
YOU ABSOLUTE HERO!

Honestly, I can't thank you enough.

I love you. Like, properly. For keeps.

THANKYOU!
Posted by Dan on 26 Nov 2008 at 9:54am
excellent bro....
thanx 4 everything.....
u brought a new life 4 me...

two thumbs up
Posted by noname on 1 Dec 2008 at 11:40pm
You're a clear example how one smart man can KILL a huge, stupid, arrogant, smelly, full of shite beast called ADOBE.

How can I send a beer over your way?

Posted by Jebac on 4 Dec 2008 at 2:28am
Thanks........
No other words to express my happyness.... [:)]
Posted by Satosh Kumar on 17 Dec 2008 at 5:09am
Thanks SOOO much!
You're a life saver.
Posted by MisterJom on 1 Jan 2009 at 1:53am
Hi, Thanks for proxy.exe, but i want to open different PDF from different butons. so its abel to only open one pdf. PLEASE Guide me.

Thanks.
From INDIA
Posted by Neelesh Upadhyay on 2 Jan 2009 at 12:09am
Just make copies of the EXE and BAT file, one for each PDF you want to open.
Posted by Tim on 2 Jan 2009 at 12:43am
i loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooove you ,you saved me , mille thanks
Posted by amira on 3 Jan 2009 at 4:23am
This is coooooooooooooool
you're the best tim
Posted by Ahmed elshrkawey on 14 Jan 2009 at 5:08am
THANK YOU VERY VERY MUCH... :)
Posted by laranjinha on 15 Jan 2009 at 8:32am
Woooow... it's awesome, work like a charm!! You're really great, u know.. Been searching everywhere to solve that problem, till i found your tool. Really great.. Thank u so much, bro..
Posted by Eddy Surahman on 9 Jan 2009 at 10:26pm
Wooow you are the man!
Thank you very much
Posted by Andres on 22 Jan 2009 at 4:41pm
Wow..
after wasting over a day, you have helped me sort this out.
u r a legend ;)

why on earth has adobe not sorted this out!?!?

greg
Posted by Greg cook on 27 Jan 2009 at 4:45am
man, your proxy is ******* amazing stuff for my project!
thanks from russian guy


Posted by chunya on 29 Jan 2009 at 9:46am
Thanks! This worked great for opening my PDFs from Flash. I was wondering if this would work to open up a windows explorer window as well. If so, what would those steps be?
Posted by Beth on 9 Feb 2009 at 12:17pm
Sure, just put something like this in your BAT file...

explorer c:\

The "explorer.exe" is not Internet Exporer but the Windows Explorer and if you google around you'll find it has a slew of command line options you can use.
Posted by Tim on 9 Feb 2009 at 1:20pm
Awesome script!
My projector is fullscreen by default but after opening the pdf it goes to normal 100% view. Any way of keeping it fullscreen, PLUS making the pdf appear in focus over the top of the Flash projector???
Posted by Dave on 16 Feb 2009 at 1:14am
That's another issue you can read about in this post: Problem with Fullscreen Flash Projectors
Posted by Tim on 16 Feb 2009 at 2:06am
hey tim you = awesome i just scrolled through and read how many people you helped with your work ..

do you have a link or update on how to use a simlar solution on a mac.

im on a quest right now to find the answer if i do ill post back here.

either way muchas gracias knowing how to do this on windows helps out a lot!

thank you thank you
Posted by sergio on 20 Feb 2009 at 1:17am
GOD BLESS YOU
Posted by Alexis on 20 Feb 2009 at 2:54pm
Thanks so much definetly a life saver! My client was busting my ass and I still was trying to do the fscommand EXEC trick which wasn't working anymore. Thank you so much for the exe :)
Posted by Fahim Akhter on 23 Feb 2009 at 8:10am
hi, i try it on mac and it didn't work. any solutions for that ?
Posted by amirul on 1 Mar 2009 at 10:23pm
It's a Windows only solution, I don't have anything similar for the Mac. Sorry.
Posted by tim on 1 Mar 2009 at 11:26pm
from the morning I was trying to overcome this problem. the only and final solution is from you. thank you man it is a great job.
Posted by ali on 7 Mar 2009 at 9:36am
you're the best! I can't believe that there is a way to do this for free. I was about to invest in a $300 program. This change everything. Thanks, you're a saint, bro!

Posted by rod on 14 Mar 2009 at 3:14pm
I make one of those "$300 programs" but it's overkill if all you're doing is launching BAT files so FREE is about the right price for that :)
Posted by tim on 14 Mar 2009 at 3:48pm
Thanks a million, Been trying for ages to get that black screen that comes with using .bat files off.

You're a life saver. Ring me whenever you're in Nigeria. I'll get you a chieftaincy title.
Posted by demola on 15 Mar 2009 at 2:49pm
Thank you man, I have been searching for something like this for long time. Such an irritating thing solved in no time. Works perfect!
Posted by kele on 27 Mar 2009 at 10:09pm
Awesome!! Wonderful tool!

Question: I have a .bat file that calls another .bat file. The first file passes arguments to the second file. I would like to use proxy.exe to keep the dreaded black box from popping up on both files. However, it doesn't appear that I can achieve this since I need to pass arguments from .bat file to the other. Is this a correct assumption?

Thank you!
Posted by mmcneill on 30 Mar 2009 at 4:43pm
I just modified the proxy tool to pass whatever command line arguments it gets to the BAT file. The version of proxy.exe with that change is 3.1. I just uploaded it to the blog and I sent you a copy by email.
Posted by Tim on 30 Mar 2009 at 5:03pm
thank you ....you make me happy realy...iiiiiii love you hhhhhhhhh:-)
Posted by moad on 3 Apr 2009 at 12:56am
Hello and thank you so much for this tutorial. It really helped me a lot on my work. Like many had said before me, i try using fs execute in Flash and it never work until i saw this.

I try using in Window XP and it works like a charm. But when i brought this to Vista. It couldn't execute. So what could be the problem? I'm using Adobe Flash CS 4 but i continue to save the file in CS3 and execute the Projection file as Flash Player 9.

Please advise....
Posted by Sapphire on 8 Apr 2009 at 12:23am
What is the name of the EXE file you are trying to launch? Does the EXE have a "shield" on the icon?

Vista makes some assumptions about what you're trying to do based on the name of the EXE. If you have the "setup", "install" (or a few others) in the file name, Vista thinks those apps should have admin rights and when you try to launch them as a normal user they will fail. The shield on the icon is the clue that Vista thinks the application might need more rights.

You could also be running into the problem using the start command in Vista that I describe in this post: Fixing the Windows Start Command in Vista.
Posted by Tim on 8 Apr 2009 at 1:36am
WOW! now I don't have to do all our Autorun cd's with MultiMedia Builder, Flash just looks better.

Thanx a Stack!
Posted by Mariaan on 13 Apr 2009 at 10:48am
Thanks a lot!

I thought I was doing something wrong with the code. :)
Posted by oconel on 20 Apr 2009 at 7:04am
Hey man thanks a lot this works perfect but i Have
a little problem it works perfectly with .exe files
but it doesn't work with .msi Setup packages
so do you have any ideas to work this out.
Thanks,
Posted by Adeli on 21 Apr 2009 at 11:41am
I'm gonna need a few more details about how it "doesn't work". I've sent you an email :)
Posted by Tim on 21 Apr 2009 at 2:28pm
That REALY help to solve one more Vista issue....

Thanks!!!!
Posted by Gabriel Melo on 22 Apr 2009 at 9:22am
Hi! I'm from Croatia and this is a thing I've been looking for for months... This is GREAT STUFF! I can't thank you enough...
Posted by Alex on 23 Apr 2009 at 6:00pm
This works perfectly for me except excel files on XP machines. Why does it work on Vista but not XP and can you help?
Posted by Michael on 24 Apr 2009 at 3:41pm
Sure, what are you trying to do?
Posted by Tim on 24 Apr 2009 at 5:36pm
It is really great. Can it modified to run in vista without admin permission.
Posted by Clerison on 25 Apr 2009 at 11:59am
You don't need admin permissions to make proxy work on Vista, unless what you're doing requires admin permissions, like running an installer or setup program.
Posted by Tim on 25 Apr 2009 at 1:03pm
THANK YOU TIM............... Thank you
Posted by Isam M. Wali on 26 Apr 2009 at 7:46am
:-)
Thank you very much!
Posted by Abel B. on 28 Apr 2009 at 4:31pm
Thanks Tim, this was a great help.
Posted by Uiliam Cruz on 2 May 2009 at 5:45pm
Thx
Posted by EvilBeaver on 3 May 2009 at 10:03am
Thanks a lot !!!
As with many others' you helped me a lot.

I had a question about weather you can pass arguments
to the .bat file or if you can just call it ?
Posted by Boris on 6 May 2009 at 5:38pm
You can just call it. You haven't been able to pass arguments with EXEC since Flash MX was release.
Posted by Tim on 6 May 2009 at 6:13pm
Just one phrase: You Rock!
Posted by Manuel on 7 May 2009 at 12:22am
This method was a lot of help on my last project. Could this work for opening swf files from a windows projector as well? I got it working outside of flash (just double clicking the bat file and it opens the swf). But I can't seem to get it to work from within my flash projector.
Posted by Beth on 7 May 2009 at 1:57pm
The proxy tool was designed to be called from a Flash projector. The example in the ZIP file shows how to call it from a Flash projector. The easiest way is to put the BAT file, the renamed proxy.exe file and the file you want to open in the FSCommand folder. Check out the example!
Posted by Tim on 7 May 2009 at 2:13pm
hey, I'd like to know how to make a .bat file to trigger .exe from another folder
(which exists with the .bat file ) thanks,
Posted by ali on 12 May 2009 at 3:59am
You can execute any EXE file by putting it's name on a line by itself in the BAT file. If th EXE file is not in the same folder, include the path (relative or absolute) to where the EXE is located.
Posted by Tim on 12 May 2009 at 4:30am
Thanks a lot for your proxy.exe. I got rid of my great problems that i was facing. Now I can prepare a good CD presentation to distribute our software.
Posted by Arun on 13 May 2009 at 6:35am
GRACIAS hombre este es el único que funciono!!!

TNKS TNKS!!
Posted by Santos on 13 May 2009 at 6:39am
Hi Tim,

I tried to do exactly the same thing, launching a pdf file from a flash projector via the fscommand mechanism. I wrote a small executable (VC++) that opens the pdf.

From the flash projector it takes up to 10 seconds until the pdf appears (which is unacceptable), but if I start the exe directly it works instantaneously.
So I googled around and hit your website with the nice proxy application that does the same. Unfortunately I cannot use your tool because my application is for company-wide distribution and the IT guys won't let me distribute software without having the source code from which they know it doesn't anything bad.

So can you give me a hint what might be causing the delay? I tried ShellExecute, the system("...") call, CreateProcess, always the same.

Thanks very much...
Gizmo
Posted by Gizmo on 15 May 2009 at 7:19am
Hi Gizmo :)

The proxy application is being used by thousands of people all over the world and it's been shipped as part of large commercial CD distributions. The code doesn't do anything malicious, it just opens files. We've signed the application too so that you know you have a clean copy. That said, I know how the "IT guys" can be with their networks :)

Proxy uses CreateProcess to run the BAT file and doesn't really do anything special except fix up the command line it's passed to resolve the UNC path. If you want to show me the CreateProcess call you're using I'll have a look at it for you.
Posted by Tim on 15 May 2009 at 7:46am
Hi Tim,
the CreateProcess call doesn't really work because of the pain-in-the-a-UNC path problem. Says cannot find the file.
I just called it like this:
CreateProcess(appName, NULL, NULL, NULL, FALSE, HIGH_PRIORITY_CLASS, NULL, NULL, &si, &pi), where appName is the batch file, si and pi are startup and process information structs.
ShellExecute and system are cause the delay I mentioned above.

Thanks for your help, you can also reply by email if you prefer.

Gizmo
Posted by Gizmo on 16 May 2009 at 5:23am
Leave the lpApplicationName NULL and use the lpCommandLine instead. This also allows you to tell CreateProcess to run a BAT file using CMD.EXE (or command.com, depending on which OS you're using). When you use the lpApplicationName, Windows assumes this might be a partial file name and tries to complete it for you, which may explain why you're seeing a delay there. Not sure why that would happen with ShellExecute though. I'm going to send you some code from proxy so you can see how I'm doing it. Hopefully that will help!
Posted by Tim on 16 May 2009 at 5:43am
Thanks! This explained it all very well!
Posted by Nathan on 21 May 2009 at 11:09am
Yeah, thanks very much Tim, I think I'll get along now.

Best, Gizmo
Posted by Gizmo on 22 May 2009 at 5:25pm
This question may be off topic a bit, but if anyone knows the answer I thought it would be you. I have a data dvd with a flash menu that opens pdfs using bat files and the proxy file. I wrote the bat files with a path to the D drive where all the files are located on the dvd and it works great. Problem is, not all of the users of this disc have the D drive assigned as their DVD drive. Do you know if there is a way to use this method with out it mattering which drive letter that the user's DVD is assigned to?

Thanks for all your help!
Posted by BethVanVel on 26 May 2009 at 9:56am
You can find the drive letter where your EXE was started from by examining the _url variable (in AS2) like this:

drv = _url.substr(8,1);
getURL(drv+":");

From that you can form a path to any folder on the CD/DVD since they won't be changing after you publish.
Posted by Tim on 26 May 2009 at 10:43am
bro it works awesomely perfect on my pc but when i write a cd then it stop working what am i suppose to do now :( plz help deadlines to meet or i will be dead
Posted by shakil on 27 May 2009 at 4:11am
Have you got a hard coded path in your BAT files or in your FLA that would make it work only on your machine?
Posted by Tim on 27 May 2009 at 4:30am
MERCI BEAUCOUP (Thks you very much)

I love you
Posted by atinao on 28 May 2009 at 5:39am
Hi,

I have 14700 PDF files. And if I should make 1 EXE for each PDF, then total size of EXE files becomes around 800 MB!

Is there another way to do this? Any suggestions? Can same EXE file be used for every PDF and BAT files??

Thanks...
Posted by Sinan on 1 Jun 2009 at 3:11am
You can't use one EXE file for everything because you can't pass parameters from Flash via the EXEC command. The only solution that doesn't involve creating one helper file per document that you want to open is a third party swf2exe utility like SWF Studio.
Posted by Tim on 1 Jun 2009 at 4:13am
Leave a Comment

Add a comment by filling out the form below. All comments will be reviewed before they appear.
You only need to provide a valid email address if you need/want a personal reply to a question.
Your email address will not be shown and you won't get spammed for using it.

name:

email:

website:

comment:




← Back
 

copyright © 2000-2008 Northcode Inc  ·  all rights reserved  ·  contact us  ·  report piracy  ·  privacy policy