By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,842 Members | 2,368 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,842 IT Pros & Developers. It's quick & easy.

PATH Environmental Variable start/run permission

P: n/a
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 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a


jt*****@eudoramail.com 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/
Sep 26 '05 #2

P: n/a

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
Sep 27 '05 #3

P: n/a

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 '05 #4

P: n/a

jt*****@eudoramail.com 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/
Sep 28 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.