Re: How to call an windows program with ActiveXObject and load a file as well?



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 message
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
Sorry, it were double quoted. Somehow the copy/paste got messed up,
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.
.



Relevant Pages

  • Re: Installing Quicken in Program Files
    ... Quicken in the Program Files folder. ... install the ... Under Vista with UAC enabled, a user, even an Admin user is prohibited ...
    (microsoft.public.windows.vista.general)
  • Re: QCReports demo
    ... 64 MB Windows 98 for two reasons: to be sure that I'm not doing something dumb and excessively resource comsumptive. ... run equally well on Windows 98/NT/Me/XP and Vista, ... Temporary elevation of privilege is needed to put those DLLs in its Program Files folder on Vista and this is now the preferred option; but if the user can't grant those privileges, the program has to get creative with the Virtual Store folder. ...
    (comp.sys.hp.mpe)
  • Re: Removing .ax file
    ... Program Files folder that contains a file: ... Vista won't let me delete the file or folder, ... Tempted to try deleting it with unlocker -- but before I do that: ...
    (microsoft.public.windows.vista.performance_maintenance)
  • Re: Vista x86 program folder not showing in directory
    ... Hold down the Windows logo key, like a Shift key, while you press the key, which is found in the upper right area of most keyboards. ... Using either method of access, the System Properties window should show your Windows edition (Windows Vista Home Premium) and, if it has been installed, "Service Pack 1". ... The "Program Files " folder appears ONLY on 64-bit operating systems. ... all programs will be in the one Program Files folder. ...
    (microsoft.public.windows.vista.file_management)
  • Re: downloaded program files folder question
    ... SP2 has somehow changed some things with the Downloaded Program Files folder. ... Also why won't my flash card reader not show the drives in my computer ...
    (microsoft.public.windowsxp.help_and_support)