PATH Environmental Variable start/run permission

Discussion in 'Javascript' started by jtfaulk@eudoramail.com, Sep 26, 2005.

  1. Guest

    I've created an application that I need to launch from a web browser.
    So I tried these steps:

    1. on the install I modified the PATH environmental variable to include
    the path on the application directory.
    2. on the web pages uses java script to call ShellExecute to call the
    application.

    This actually does launch the application; however there seems to be a
    permission error. Because if I simply launch the application normally
    (either by clicking the executable or the shortcut) the app launches
    fine. However when I launch from the javascript shellexecute it errors
    out at the line of code when I try to delete some temp files.

    Bascially it doesn't have permission to delete the temp files when i
    launch the app from the java script; but does when I lauch from the
    shortcut.

    Does anybody have any idea how I can remedy this?
    , Sep 26, 2005
    #1
    1. Advertising

  2. wrote:

    > I've created an application that I need to launch from a web browser.
    > So I tried these steps:
    >
    > 1. on the install I modified the PATH environmental variable to include
    > the path on the application directory.
    > 2. on the web pages uses java script to call ShellExecute to call the
    > application.


    "java script"? And "ShellExecute"? Is ShellExecute a function a browser
    exposes to JavaScript? Which browser is that?
    I think you need to be more specific, you might be targetting Windows
    and IE and try to access the WSH shell object or the Windows shell
    object but perhaps you are doing something completely different.


    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
    Martin Honnen, Sep 26, 2005
    #2
    1. Advertising

  3. Guest

    Danny wrote:
    > Yes, he's ranting about WSH.exe calls through an activeX object in IE win32
    > ONLY.
    >
    > On the specific matter, you're not supposed to be launching any
    > executables to begin with from js, and the permission issue is due to
    > settings on activeX scripts defaults on IE-win32, bear in mind that is good
    > only in win32 IE, not elsewhere, and for NTFS filesystems, it may also
    > encounter OS permission enforcements based on the account logged in.
    > Either way, if you need to run/access executables, use a server sided
    > language, ASP or PHP or if you need it for IE only, VBS.
    >
    >
    > Danny



    Ok I figured this out what was our problem: it was NOT a permission
    issue.

    You can in fact use the ShellExecute in js to launch applications (no
    prob). The problem was how we were determining the CurAppPath (or the
    path of the directory where the application is currently installed).
    When we launched the application normally this worked fine; but when we
    tried to launch it from the shellexecute in js the path I got was wrong
    (i'm not sure is it was the path where the browser was located or where
    the scrun (?) was located). So when we fixed that it was ok; no
    permission errors.

    Thank you
    , Sep 27, 2005
    #3
  4. wrote:

    > You can in fact use the ShellExecute in js to launch applications (no
    > prob).


    If it works with your particular settings and requirements then fine,
    but in general with normal security settings IE does not allow a web
    page loaded via HTTP to do stuff like

    var wshShell = new ActiveXObject('WScript.Shell');
    wshShell.Run('notepad.exe');

    the object creation will not be allowed.

    And with Windows XP SP 2 and IE there script and ActiveX in HTML
    documents loaded from the file system is disabled by default and only if
    the user after a warning allows it the page is reloaded with script and
    ActiveX enabled.

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
    Martin Honnen, Sep 28, 2005
    #4
    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. google 24/7
    Replies:
    0
    Views:
    390
    google 24/7
    Feb 18, 2006
  2. Kourosh
    Replies:
    2
    Views:
    913
    Joe Kesselman
    May 20, 2006
  3. iavian
    Replies:
    7
    Views:
    1,327
    Keith Thompson
    May 11, 2008
  4. timr
    Replies:
    2
    Views:
    116
    Robert Klemme
    Jan 20, 2009
  5. John Smith

    Environmental variable for CGI proxy

    John Smith, May 16, 2006, in forum: Perl Misc
    Replies:
    1
    Views:
    157
    Gunnar Hjalmarsson
    May 16, 2006
Loading...

Share This Page