View Full Version : Launch local programs from Active Desktop?
Chemical Spill
09-06-2002, 03:48 AM
OS=Windoze 98se
Using an HTML page as a desktop, icons are hidden, is it possible to launch local programs on my system, preferably shortcut (lnk) files? I've tried the simple <a href=, but I get a "File Download" message window asking if I want to download or open it. If I choose open, it will launch the desired app, but that extra step spoils the simplicity. The "Always ask before opening this type of file" is checked on and is grayed out. I'm not sure for security while on-line that I would want that unchecked.
My goal is to use flash buttons to launch my most common apps, preferably through lnk files, but will settle for clickable images. The latter I have seen on a Vaio system I used to have but I dont have any copies of that desktop to view the code.
So is there a work around?
joh6nn
09-06-2002, 03:56 AM
<script>
var objShell = new ActiveXObject("WScript.Shell");
</script>
<A HREF="javascript:objShell.Run('C:\pathto\program.exe');">click click</A>
Chemical Spill
09-06-2002, 05:00 AM
Hey Joh6nn, it no workie :(
I copied your code and pasted in my file, editing the 'C:\pathto\program.exe' to read 'C:\WINDOWS\NOTEPAD.EXE' for a simple test. When the page is first loaded it give me the message:
An active X control on this page might be unsafe to interact with other parts of the page. Do you want to allow this interaction?
yes/no
I answer yes but the created link does nothing, status bar changes to
javascript:objShell.Run('C:\WINDOWS\NOTEPAD.EXE');
when the mouse is over the link, clicking it does nothing but the status bar then says "Error on page".
So far this is a simple HTML page with nothing other than an image displayed in a table, no java scripts, and this new link was place outside of that table. I also tried pointing the link to a shortcut lnk file with no change in behavior.
<edit>
Oh yeah, I also tried launching the file in a IE6 window with no change in behavior verses the as an Active Desktop.
joh6nn
09-06-2002, 05:05 AM
i don't know what to tell you. it runs fine on my machine, which is win 98. try checking your security settings, and try downloading the latest version of the Windows Scripting Host, and microsoft.com .
Chemical Spill
09-06-2002, 05:42 AM
Well I down loaded Windows Script 5.6 and installed it. And I enabled several things in the security settings, I dont really know what they do but might'a/sorta looked relevant.
There is now no change in the behavior when the file is opened in a browser window, but as a desktop it opens a new browser window with the "page cannot be found" page displayed. And
javascript:objShell.Run('C:\WINDOWS\NOTEPAD.EXE');
appears in the browser address window.
Are there any errors in my code below that migh cause this? Does the first part need to be in the header or the body? I tried it in both with no change.
<script>
var objShell = new ActiveXObject("WScript.Shell");
</script>
<A HREF="javascript:objShell.Run('C:\WINDOWS\NOTEPAD.EXE');">click click</A>
Is this the only solution? I've also tested this on my other systems also running Win98se and they behave exactly the same, no workie.
joh6nn
09-06-2002, 06:23 AM
i can't help ya, man. it's the only way i know of to do it, and as far as i can tell, you're doing it right. i've given dozens of other people the same answer, and it's always seemed to work for them, and it's working for me on my machine. i can't think of anything that it could be.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.