Re: How to call an windows program with ActiveXObject and load a file as well?
- From: Stevo <no@xxxxxxxxxxxx>
- Date: Wed, 01 Jul 2009 08:55:33 +0200
Don84 wrote:
On Jun 30, 6:15 pm, Don84 <tatata9...@xxxxxxxxx> wrote:On Jun 30, 6:00 pm, "Paul E. Schoen" <p...@xxxxxxxxxxxx> wrote:
"DL" <tatata9...@xxxxxxxxx> wrote in messageSorry, it were double quoted. Somehow the copy/paste got messed up,
news:46d3176d-e468-45ad-8fa6-458d74500bb9@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
prog = "mspaint.exe C:\\'Program Files'\\myProgram\\myImageFiles'+f;^ ^
I think these need to be both double quotes
prog = "mspaint.exe C:\\Paint\\myImageFiles'+f;^ ^
Same here?
Paul
it were like the following:
prog = "mspaint.exe C:\\'Program Files'\\myProgram\\myImageFiles"+f;
Just thought of old DOS 8.2 convention, tried the following instead,
prog = "mspaint.exe C:\\Progra~1\\myProgram\\myImageFiles"+f;
it works with IE7 on XP SP3 but not Firefox 3.0.11 on the same
machine. so, it's only half good.
It's actually called DOS 8.3 convention, but you can avoid that by using %20 instead of spaces. So this would work on IE:
prog = "mspaint.exe C:\\Program%20Files\\myProgram\\myImageFiles"+f;
All non-IE browsers (that I know of) prefer a different format though. Instead of C:\\ and backslashes throughout, you'd want file:///c:/ and forward slashes throughout.
Finding your perfect string to use is easy. Just put an image into your desired folder, and then drag/drop it onto Firefox. You'll see in the address bar a URL like this:
file:///C:/Program%20Files/some%20folder/deleteme.gif
The good news is that IE will accept that URL also.
Warning #1
Putting images in the program files folder is a bad idea. I believe Vista won't let mspaint save them there. It's been a "best practice" for a long time, going back to the old Petzold books for Windows programmers to not write anything into the program files folder. Only the installer should write there. For already installed programs that want to store data, they should use the local settings application data folders instead. When Vista came along, instead of that just being a recommended practice, it became enforced. This was one of the big reasons that a lot of software needed updating for Vista.
Warning #2
The folder named "Program Files" is a localized name. In other languages it's called something else - usually the foreign translation of one or both of those english words.
.
- Follow-Ups:
- References:
- Prev by Date: Re: Using eval('(' + evalText + ')')
- Next by Date: Re: Should isHostMethod be added to the FAQ?
- Previous by thread: Re: How to call an windows program with ActiveXObject and load a file as well?
- Next by thread: Re: How to call an windows program with ActiveXObject and load a file as well?
- Index(es):
Relevant Pages
|