If you can execute the program from command line in Windows 10, then I am pretty sure that you are either in the directory where this program is located or the program is in the path. So, just type the word "PATH" and press enter. See what it says. The program should be in one of those paths listed. They are separated by a semicolon. Or if it's not, then type "CD" and press Enter. It will give you the current directory and just see if it's there. Type "DIR *.EXE /P" to see what program files you have in the current directory. So, once you locate the program, then you have to execute it using full path. For example, system("C:\\MyProgram\\myprog.exe"); Don't forget to put double \\ because \ is an escape character, it must be doubled for it to produce a single \

For example, the following perl program line will launch Microsoft Word on my PC:

system("C:\\Program Files\\Microsoft Office\\OFFICE11\\WINWORD.EXE");


When I try the same in JSScript, an interesting thing happens... Hmmm..


// This doesn't work for some reason:
// new ActiveXObject("WScript.Shell").Run("C:\\Program Files\\Microsoft Office\\OFFICE11\\WINWORD.EXE");

// This one works.
new ActiveXObject("WScript.Shell").Run("C:\\PROGRA~1\\MICROS~2\\OFFICE11\\WINWORD.EXE");

Well, this is quite lame. It appears that if your folder or program name has spaces in it or is longer than 8+3 characters that is standard in DOS, then the program must be referred to by its 8+3 name. This is beyond stupid, but this could be the reason why you can't launch the program from JS.


In reply to Re: Program Not Found when run from browser page by harangzsolt33
in thread Program Not Found when run from browser page by BeliBmSoft

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.