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



On Jul 1, 2:55 am, Stevo <n...@xxxxxxxxxxxx> wrote:
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@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
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.- Hide quoted text -

- Show quoted text -

Sorry,
prog = "mspaint.exe C:\\Program%20Files\\myProgram\\myImageFiles"+f;

did not work for neither IE7 nor Firefox 3.0.11.

On DOS convention, possibly my typo, 8.3 or my post has been hijacked.
On not placing images into "Program Files" folder, I'm with you,
however, the images are associated with a given program under "PF" ...

Thanks though.


.



Relevant Pages

  • LongWinded Folder Names...
    ... I assume from you comments that like me you delve into DOS ... longwinded folder names? ... >3) Program Files: Should be PROGRAMS (It is obvious ... sorry) and in mild pain ...
    (microsoft.public.windowsxp.general)
  • Re: Errors during SBS 2003 SP1 Installation
    ... I think here's where you went wrong, the regedit of the 'Program Files' dir. ... reg hacking SBS is not to be taken lightly. ... ..Microsoft Office 97 Standard Edition ... is that I changed the program files folder to D: ...
    (microsoft.public.windows.server.sbs)
  • Re: removing folders from program files
    ... It's not a crime to remove sub-folders from the 'Program Files' ... The 'Common Files' folder within 'Program Files' ... It's a rarer occurrence that the program installed a windows 'service', ... I have this folder called "Emergent Music LLC" in my Program Files ...
    (microsoft.public.windowsxp.general)
  • Re: Vista Program Files Folder Problem - Issue 1
    ... It had been very convenient to simply copy the files to their final locations using a batch script; I just now need to make my batch script a little bit smarter to place the data file into the virtualized folder. ... Storing data in the Programs Files directory has never been a good practice and Vista actively prohibits it. ... I created a directory in Program Files and placed a front-end MS Access database in it and a back-end database into a subfolder; ...
    (microsoft.public.windows.vista.security)
  • Re: Word 2007 equation galleries are blank
    ... N.B. in the French version of Vista 'Program files' has the stupidly incorrect alias 'Programmes', which can make life a bit difficult for non-USA users. ... problem to the one in the %appdata% folder. ... I did that, exactly as you described, but the gallery still isn't populated. ... The workings of the equation editor are too chaotic to be describable ...
    (microsoft.public.word.application.errors)