How to call an windows program with ActiveXObject and load a file aswell?

Discussion in 'Javascript' started by DL, Jun 30, 2009.

  1. DL

    DL Guest

    The following code to launch Windows Paint program with an image file
    failed. The problem seems related to the location of the image file
    under the Program Files folder (for the white space between the two
    words).

    <script language="JScript">
    function runPaint(f) {
    prog = "mspaint.exe C:\\'Program Files'\\myProgram\\myImageFiles'+f;
    WSH = new ActiveXObject("WScript.Shell");
    WSH.run(prog);
    }
    </script>

    Had the image file located in a folder without spaces, say, Paint,
    then, the following code would work,
    <script language="JScript">
    function runPaint(f) {
    prog = "mspaint.exe C:\\Paint\\myImageFiles'+f;
    WSH = new ActiveXObject("WScript.Shell");
    WSH.run(prog);
    }
    </script>

    I can't change the image location, how to escape the white space? how
    to solve it?

    Thanks.
     
    DL, Jun 30, 2009
    #1
    1. Advertising

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

    "DL" <> wrote in message
    news:...
    >
    > 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
     
    Paul E. Schoen, Jun 30, 2009
    #2
    1. Advertising

  3. DL

    Don84 Guest

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

    On Jun 30, 6:00 pm, "Paul E. Schoen" <> wrote:
    > "DL" <> wrote in message
    >
    > news:...
    >
    > > 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;
     
    Don84, Jun 30, 2009
    #3
  4. DL

    Don84 Guest

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

    On Jun 30, 6:15 pm, Don84 <> wrote:
    > On Jun 30, 6:00 pm, "Paul E. Schoen" <> wrote:
    >
    > > "DL" <> wrote in message

    >
    > >news:....

    >
    > > > 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.
     
    Don84, Jun 30, 2009
    #4
  5. DL

    Greg Russell Guest

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

    In news:,
    DL <> typed:

    ....
    > prog = "mspaint.exe C:\\'Program Files'\\myProgram\\myImageFiles'+f;

    ....
    > I can't change the image location, how to escape the white space?

    ....

    Quote and backslash problems:

    prog = "mspaint.exe 'C:\\Program Files\myProgram\myImageFiles\'"+f;
     
    Greg Russell, Jul 1, 2009
    #5
  6. DL

    Stevo Guest

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

    Don84 wrote:
    > On Jun 30, 6:15 pm, Don84 <> wrote:
    >> On Jun 30, 6:00 pm, "Paul E. Schoen" <> wrote:
    >>
    >>> "DL" <> wrote in message
    >>> news:...
    >>>> 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.
     
    Stevo, Jul 1, 2009
    #6
  7. DL

    Don84 Guest

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

    On Jul 1, 2:55 am, Stevo <> wrote:
    > Don84 wrote:
    > > On Jun 30, 6:15 pm, Don84 <> wrote:
    > >> On Jun 30, 6:00 pm, "Paul E. Schoen" <> wrote:

    >
    > >>> "DL" <> wrote in message
    > >>>news:....
    > >>>> 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.
     
    Don84, Jul 1, 2009
    #7
  8. DL

    Don84 Guest

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

    On Jun 30, 10:09 pm, "Greg Russell" <> wrote:
    > Innews:,
    > DL <> typed:
    >
    > ...> prog = "mspaint.exe C:\\'Program Files'\\myProgram\\myImageFiles'+f;
    > ...
    > > I can't change the image location, how to escape the white space?

    >
    > ...
    >
    > Quote and backslash problems:
    >
    > prog = "mspaint.exe 'C:\\Program Files\myProgram\myImageFiles\'"+f;


    Sorry it didn't work with IE7 nor Firefox 3.0.11. Could it because I
    have two anti-virus programs up and running? but then with the same
    security setting the Progra~1 worked with IE7 ...
     
    Don84, Jul 1, 2009
    #8
  9. Re: How to call an windows program with ActiveXObject and load a fileas well?

    On Jul 1, 3:58 pm, Don84 wrote:
    > On Jun 30, 10:09 pm, Greg Russell wrote:

    <snip>
    >> Quote and backslash problems:

    >
    >> prog = "mspaint.exe 'C:\\Program Files\myProgram\myImageFiles\'"+f;

    ^
    > Sorry it didn't work with IE7 nor Firefox 3.0.11.


    At least one good reason for that not working is the positioning of
    the final apostrophise. Windows would like to see them (or double
    quotes) around the entire file path, but the final apostrophe is
    inserted before whatever is added to the string by concatenating the -
    f - value.

    A second reason is going to be the backslashes. Backslashes may be
    file path separators in Windows but they are escape characters in
    javascript string literals. A single backslash in a string literal
    will not appear in the resulting string, instead it acts in
    conjunction with following characters to form 'escape sequences'. For
    example, "\t" results in a string containing the tab character, and
    "\m" results in a string containing the lower case M character
    (because there is no special meaning to "\m"). To get a backslash into
    the resulting string (which is going to be (nearly) essential in a
    Windows file path) the backslash has to be escaped, by substituting it
    with one of "\\", "\u005C" or "\x5C", which are the three possible
    'escape sequences' for the backslash character.

    > Could it because I have two anti-virus programs up and running?


    Unlikely.

    > but then with the same security setting the Progra~1 worked with
    > IE7 ...


    You do realise that instantiating WScript objects is only feasible in
    a reduced security context (so not on the public internet)?

    Richard.
     
    Richard Cornford, Jul 1, 2009
    #9
  10. Re: How to call an windows program with ActiveXObject and load a fileas well?

    On Jul 1, 3:56 pm, Don84 wrote:
    <snip>
    > prog = "mspaint.exe C:\\Program%20Files\\myProgram\\myImageFiles"+f;
    >
    > did not work for neither IE7 nor Firefox 3.0.11.

    <snip>

    No it wouldn't. URI encoding is (mostly) only appropriate with/in
    URIs, it is not going to mean much in a Windows file path.

    Incidentally, how exactly do you propose creating the wscript object
    in Firefox?

    Richard.
     
    Richard Cornford, Jul 1, 2009
    #10
  11. DL

    Don84 Guest

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

    On Jul 1, 11:20 am, Richard Cornford <>
    wrote:
    > On Jul 1, 3:56 pm, Don84 wrote:
    > <snip>> prog = "mspaint.exe C:\\Program%20Files\\myProgram\\myImageFiles"+f;
    >
    > > did not work for neither IE7 nor Firefox 3.0.11.

    >
    > <snip>
    >
    > No it wouldn't. URI encoding is (mostly) only appropriate with/in
    > URIs, it is not going to mean much in a Windows file path.
    >
    > Incidentally, how exactly do you propose creating the wscript object
    > in Firefox?
    >
    > Richard.


    Yes, I understand the security ramification of the ActiveXObject call,
    it's local and offline use.
     
    Don84, Jul 1, 2009
    #11
  12. Re: How to call an windows program with ActiveXObject and load a fileas well?

    On Jul 1, 5:01 pm, Don84 wrote:
    > On Jul 1, 11:20 am, Richard Cornford wrote:

    <snip>
    >> Incidentally, how exactly do you propose creating the wscript
    >> object in Firefox?

    <snip>
    > Yes, I understand the security ramification of the ActiveXObject
    > call, it's local and offline use.


    Security aside, Firefox does not even have the ActiveXObject
    constructor (unless they have added it very recently). So when you say
    that you cannot get this to work in Firefox, seeing the code you have
    posted, that would be the expected outcome; the call to the
    ActiveXObject constructor would error, terminating the execution of
    the function.

    Richard.
     
    Richard Cornford, Jul 1, 2009
    #12
  13. DL

    Don84 Guest

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

    On Jul 1, 12:17 pm, Richard Cornford <>
    wrote:
    > On Jul 1, 5:01 pm, Don84 wrote:
    >
    > > On Jul 1, 11:20 am, Richard Cornford wrote:

    > <snip>
    > >> Incidentally, how exactly do you propose creating the wscript
    > >> object in Firefox?

    > <snip>
    > > Yes, I understand the security ramification of the ActiveXObject
    > > call, it's local and offline use.

    >
    > Security aside, Firefox does not even have the ActiveXObject
    > constructor (unless they have added it very recently). So when you say
    > that you cannot get this to work in Firefox, seeing the code you have
    > posted, that would be the expected outcome; the call to the
    > ActiveXObject constructor would error, terminating the execution of
    > the function.
    >
    > Richard.


    ok, thanks, I thought ActiveXObject belongs to Windows not IE but it
    looks like I was wrong.
     
    Don84, Jul 1, 2009
    #13
  14. Re: How to call an windows program with ActiveXObject and load afile as well?

    Richard Cornford wrote:
    > On Jul 1, 5:01 pm, Don84 wrote:
    >> On Jul 1, 11:20 am, Richard Cornford wrote:
    >>> Incidentally, how exactly do you propose creating the wscript
    >>> object in Firefox?

    > <snip>
    >> Yes, I understand the security ramification of the ActiveXObject
    >> call, it's local and offline use.

    >
    > Security aside, Firefox does not even have the ActiveXObject
    > constructor (unless they have added it very recently). [...]


    Depends. There is an ActiveX plugin for Gecko-based UAs but it appears
    development of it has stopped years ago and I don't know if it still works
    (security aside, as you have said).

    <http://www.iol.ie/~locka/mozilla/control.htm>

    There is also the IE Tab extension which can be configured so that, on
    Windows, the MSHTML ActiveX/COM control is used for rendering on
    user-defined Web sites (uses regular expression matching on the URI). In
    particular, this is how I made the Foxit Reader plugin work with Firefox on
    my office desktop (I don't remember if their new Firefox plugin had the same
    functionality. You certainly don't want to use the Adobe Reader plugin with
    Firefox because AFAICS it continues running and in the process eats up free
    memory like candy -- until there is no more.)

    <https://addons.mozilla.org/firefox/addon/1419>


    PointedEars
     
    Thomas 'PointedEars' Lahn, Jul 1, 2009
    #14
  15. DL

    Don84 Guest

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

    On Jul 1, 4:57 pm, Thomas 'PointedEars' Lahn <>
    wrote:
    > Richard Cornford wrote:
    > > On Jul 1, 5:01 pm, Don84 wrote:
    > >> On Jul 1, 11:20 am, Richard Cornford wrote:
    > >>> Incidentally, how exactly do you propose creating the wscript
    > >>> object in Firefox?

    > > <snip>
    > >> Yes, I understand the security ramification of the ActiveXObject
    > >> call, it's local and offline use.

    >
    > > Security aside, Firefox does not even have the ActiveXObject
    > > constructor (unless they have added it very recently). [...]

    >
    > Depends.  There is an ActiveX plugin for Gecko-based UAs but it appears
    > development of it has stopped years ago and I don't know if it still works
    > (security aside, as you have said).
    >
    > <http://www.iol.ie/~locka/mozilla/control.htm>
    >
    > There is also the IE Tab extension which can be configured so that, on
    > Windows, the MSHTML ActiveX/COM control is used for rendering on
    > user-defined Web sites (uses regular expression matching on the URI).  In
    > particular, this is how I made the Foxit Reader plugin work with Firefox on
    > my office desktop (I don't remember if their new Firefox plugin had the same
    > functionality.  You certainly don't want to use the Adobe Reader pluginwith
    > Firefox because AFAICS it continues running and in the process eats up free
    > memory like candy -- until there is no more.)
    >
    > <https://addons.mozilla.org/firefox/addon/1419>
    >
    > PointedEars


    I thought of a simpler solution, that is, if online is detected, the
    option(button) of using ActiveXObject is simply disabled. As for
    Firefox users, yes, either advise them to add IE Tab add-on or simply
    use IE just for this app, why can't one be flexible?
     
    Don84, Jul 2, 2009
    #15
  16. Re: How to call an windows program with ActiveXObject and load a file as well?

    In comp.lang.javascript message <h2f195$prk$02$-online.com>,
    Wed, 1 Jul 2009 08:55:33, Stevo <> posted:
    >
    >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.


    In my WinXP systems, the environment variables "ProgramFiles" have the
    value "C:\Program Files".

    A JavaScript system which can execute arbitrary code should be able to
    read the environment, if necessary by executing CMD.EXE with suitable
    arguments.

    In non-English systems the name of the variable may still be
    "ProgramFiles".

    Otherwise, scan the environment for a plausible entry.

    IMHO, translating an operating system without translating programming
    languages or providing a dictionary is silly.

    I once looked (in Blackwell's) at a manual for French Algol, with
    reserved words apparently having been translated by one ignorant of the
    difference between an infinitive and an imperative.

    --
    (c) John Stockton, nr London UK. ?@merlyn.demon.co.uk DOS 3.3 6.20 ; WinXP.
    Web <URL:http://www.merlyn.demon.co.uk/> - FAQqish topics, acronyms & links.
    PAS EXE TXT ZIP via <URL:http://www.merlyn.demon.co.uk/programs/00index.htm>
    My DOS <URL:http://www.merlyn.demon.co.uk/batfiles.htm> - also batprogs.htm.
     
    Dr J R Stockton, Jul 2, 2009
    #16
  17. Re: How to call an windows program with ActiveXObject and load afile as well?

    Don84 wrote:
    > Thomas 'PointedEars' Lahn wrote:
    >> Richard Cornford wrote:
    >>> Security aside, Firefox does not even have the ActiveXObject
    >>> constructor (unless they have added it very recently). [...]

    >> Depends. There is an ActiveX plugin for Gecko-based UAs but it appears
    >> development of it has stopped years ago and I don't know if it still works
    >> (security aside, as you have said).
    >>
    >> <http://www.iol.ie/~locka/mozilla/control.htm>
    >>
    >> There is also the IE Tab extension which can be configured so that, on
    >> Windows, the MSHTML ActiveX/COM control is used for rendering on
    >> user-defined Web sites (uses regular expression matching on the URI). In
    >> particular, this is how I made the Foxit Reader plugin work with Firefox on
    >> my office desktop (I don't remember if their new Firefox plugin had the same
    >> functionality. You certainly don't want to use the Adobe Reader plugin with
    >> Firefox because AFAICS it continues running and in the process eats up free
    >> memory like candy -- until there is no more.)
    >>
    >> <https://addons.mozilla.org/firefox/addon/1419>
    >> [...]

    >
    > I thought of a simpler solution, that is, if online is detected, the
    > option(button) of using ActiveXObject is simply disabled.


    And how do you propose to detect that without an ActiveX/COM control?

    > As for Firefox users, yes, either advise them to add IE Tab add-on
    > or simply use IE just for this app, why can't one be flexible?


    IE Tab only works on Windows because (IE 5/Mac aside) IE/MSHTML only works
    on Windows natively. By contrast, Firefox/Gecko works almost everywhere.
    That's why.

    Learn to quote.


    Score adjusted

    PointedEars
    --
    var bugRiddenCrashPronePieceOfJunk = (
    navigator.userAgent.indexOf('MSIE 5') != -1
    && navigator.userAgent.indexOf('Mac') != -1
    ) // Plone, register_function.js:16
     
    Thomas 'PointedEars' Lahn, Jul 2, 2009
    #17
  18. DL

    Don84 Guest

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

    On Jul 2, 2:43 pm, Thomas 'PointedEars' Lahn <>
    wrote:
    > Don84 wrote:
    > > Thomas 'PointedEars' Lahn wrote:
    > >> Richard Cornford wrote:
    > >>> Security aside, Firefox does not even have the ActiveXObject
    > >>> constructor (unless they have added it very recently). [...]
    > >> Depends.  There is an ActiveX plugin for Gecko-based UAs but it appears
    > >> development of it has stopped years ago and I don't know if it still works
    > >> (security aside, as you have said).

    >
    > >> <http://www.iol.ie/~locka/mozilla/control.htm>

    >
    > >> There is also the IE Tab extension which can be configured so that, on
    > >> Windows, the MSHTML ActiveX/COM control is used for rendering on
    > >> user-defined Web sites (uses regular expression matching on the URI).  In
    > >> particular, this is how I made the Foxit Reader plugin work with Firefox on
    > >> my office desktop (I don't remember if their new Firefox plugin had the same
    > >> functionality.  You certainly don't want to use the Adobe Reader plugin with
    > >> Firefox because AFAICS it continues running and in the process eats upfree
    > >> memory like candy -- until there is no more.)

    >
    > >> <https://addons.mozilla.org/firefox/addon/1419>
    > >> [...]

    >
    > > I thought of a simpler solution, that is, if online is detected, the
    > > option(button) of using ActiveXObject is simply disabled.

    >
    > And how do you propose to detect that without an ActiveX/COM control?


    an http call.

    > > As for Firefox users, yes, either advise them to add IE Tab add-on
    > > or simply use IE just for this app, why can't one be flexible?

    >
    > IE Tab only works on Windows because (IE 5/Mac aside) IE/MSHTML only works
    > on Windows natively.  By contrast, Firefox/Gecko works almost everywhere.
    > That's why.


    Sorry, info provided were not sufficient. It's Windows only and no, I
    don't want to get into the fight of why not supporting all, it's not a
    public web site or app for that matter.

    > Learn to quote.
    >
    > Score adjusted
    >
    > PointedEars
    > --
    > var bugRiddenCrashPronePieceOfJunk = (
    >     navigator.userAgent.indexOf('MSIE 5') != -1
    >     && navigator.userAgent.indexOf('Mac') != -1
    > )  // Plone, register_function.js:16- Hide quoted text -
    >
    > - Show quoted text -
     
    Don84, Jul 3, 2009
    #18
  19. DL

    Don84 Guest

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

    On Jul 2, 10:50 am, Dr J R Stockton <>
    wrote:
    > In comp.lang.javascript message <h2f195$prk$-online.com>,
    > Wed, 1 Jul 2009 08:55:33, Stevo <> posted:
    >
    >
    >
    > >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.

    >
    > In my WinXP systems, the environment variables "ProgramFiles" have the
    > value "C:\Program Files".
    >
    > A JavaScript system  which can execute arbitrary code should be able to
    > read the environment, if necessary by executing CMD.EXE with suitable
    > arguments.
    >
    > In non-English systems the name of the variable may still be
    > "ProgramFiles".
    >
    > Otherwise, scan the environment for a plausible entry.
    >
    > IMHO, translating an operating system without translating programming
    > languages or providing a dictionary is silly.
    >
    > I once looked (in Blackwell's) at a manual for French Algol, with
    > reserved words apparently having been translated by one ignorant of the
    > difference between an infinitive and an imperative.
    >
    > --
    >  (c) John Stockton, nr London UK.  ?  DOS 3.36.20 ; WinXP.
    >  Web  <URL:http://www.merlyn.demon.co.uk/> - FAQqish topics, acronyms& links.
    >  PAS EXE TXT ZIP via  <URL:http://www.merlyn.demon.co.uk/programs/00index.htm>
    >  My DOS  <URL:http://www.merlyn.demon.co.uk/batfiles.htm> - also batprogs.htm.


    Sorry, the DOS/NT var of %programfiles% did not work for me, English
    OS. Also, I didn't find such a var when I start a DOS session to
    check it out. So, probably it's not available across board even for
    Windows, at least, XP, since I tried it with my XP sp3.
     
    Don84, Jul 3, 2009
    #19
  20. DL

    David Mark Guest

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

    On Jul 3, 12:06 am, Don84 <> wrote:
    > On Jul 2, 10:50 am, Dr J R Stockton <>
    > wrote:
    >
    >
    >
    > > In comp.lang.javascript message <h2f195$prk$-online.com>,
    > > Wed, 1 Jul 2009 08:55:33, Stevo <> posted:

    >
    > > >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.

    >
    > > In my WinXP systems, the environment variables "ProgramFiles" have the
    > > value "C:\Program Files".

    >
    > > A JavaScript system  which can execute arbitrary code should be able to
    > > read the environment, if necessary by executing CMD.EXE with suitable
    > > arguments.

    >
    > > In non-English systems the name of the variable may still be
    > > "ProgramFiles".

    >
    > > Otherwise, scan the environment for a plausible entry.

    >
    > > IMHO, translating an operating system without translating programming
    > > languages or providing a dictionary is silly.

    >
    > > I once looked (in Blackwell's) at a manual for French Algol, with
    > > reserved words apparently having been translated by one ignorant of the
    > > difference between an infinitive and an imperative.

    >
    > > --
    > >  (c) John Stockton, nr London UK.  ?  DOS 3..3 6.20 ; WinXP.
    > >  Web  <URL:http://www.merlyn.demon.co.uk/> - FAQqish topics, acronyms & links.
    > >  PAS EXE TXT ZIP via  <URL:http://www.merlyn.demon.co.uk/programs/00index.htm>
    > >  My DOS  <URL:http://www.merlyn.demon.co.uk/batfiles.htm> - also batprogs.htm.

    >
    > Sorry, the DOS/NT var of %programfiles% did not work for me, English
    > OS.  Also, I didn't find such a var when I start a DOS session to
    > check it out.  So, probably it's not available across board even for
    > Windows, at least, XP, since I tried it with my XP sp3.


    As far as I can remember, you have to get that with an API call (and
    are those some bad memories.)
     
    David Mark, Jul 3, 2009
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Oren

    ActiveXObject

    Oren, Nov 23, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    986
    Chris Jackson
    Nov 24, 2003
  2. =?Utf-8?B?RXVnZW5l?=

    javascript, new ActiveXObject() and events

    =?Utf-8?B?RXVnZW5l?=, Aug 14, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    13,343
    =?Utf-8?B?RXVnZW5l?=
    Aug 15, 2007
  3. Marcin Zmyslowski
    Replies:
    2
    Views:
    378
    Marcin Zmyslowski
    Jun 1, 2005
  4. IE7 and ActiveXObject Fails?

    , Nov 5, 2006, in forum: Javascript
    Replies:
    8
    Views:
    130
  5. czechboy
    Replies:
    0
    Views:
    109
    czechboy
    Apr 21, 2008
Loading...

Share This Page