PATH Environmental Variable start/run permission

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jtfaulk@eudoramail.com

    PATH Environmental Variable start/run permission

    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?

  • Martin Honnen

    #2
    Re: PATH Environmental Variable start/run permission



    jtfaulk@eudoram ail.com wrote:
    [color=blue]
    > 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.[/color]

    "java script"? And "ShellExecu te"? 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

    Comment

    • Danny

      #3
      Re: PATH Environmental Variable start/run permission


      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

      Comment

      • jtfaulk@eudoramail.com

        #4
        Re: PATH Environmental Variable start/run permission


        Danny wrote:[color=blue]
        > 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[/color]


        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

        Comment

        • Martin Honnen

          #5
          Re: PATH Environmental Variable start/run permission


          jtfaulk@eudoram ail.com wrote:
          [color=blue]
          > You can in fact use the ShellExecute in js to launch applications (no
          > prob).[/color]

          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('n otepad.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

          Comment

          Working...