Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > PATH Environmental Variable start/run permission

Reply
Thread Tools

PATH Environmental Variable start/run permission

 
 
jtfaulk@eudoramail.com
Guest
Posts: n/a
 
      09-26-2005
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?

 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      09-26-2005


http://www.velocityreviews.com/forums/(E-Mail Removed) 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/
 
Reply With Quote
 
 
 
 
jtfaulk@eudoramail.com
Guest
Posts: n/a
 
      09-27-2005

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

 
Reply With Quote
 
Martin Honnen
Guest
Posts: n/a
 
      09-28-2005

(E-Mail Removed) 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/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
is it possible to override a 'read only' environmental variable like$" ? timr Ruby 2 01-20-2009 10:47 AM
How do I export a environmental variable to a C program? iavian C Programming 7 05-11-2008 03:25 AM
possible to use an environmental variable to address the XSL file path? Kourosh XML 2 05-20-2006 03:35 AM
Environmental variable for CGI proxy John Smith Perl Misc 1 05-16-2006 02:47 PM
Environmental Path setup NetBeans4.1. Please Help! google 24/7 Java 0 02-18-2006 11:44 PM



Advertisments