Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ActiveX confusion

Status
Not open for further replies.

KarterJK

Programmer
May 11, 2004
27
US
I am a little confusd on ActiveX usage
I have a Linux and a windows Server
The windows server does not support IIS

This following code is supposed to add a
desktop icon shortcut link to my site

CODE:

<html>
<head>
<title><title>
<script language="JavaScript">
function fnGo()
{

var WshShell = new ActiveXObject("WScript.Shell");
strDesktop = WshShell.SpecialFolders("Desktop");
var oShellLink = WshShell.CreateShortcut(strDesktop + "\\RJO Player.lnk");
oShellLink.TargetPath = "oShellLink.WindowStyle = 1;
oShellLink.IconLocation = " 0";
oShellLink.Hotkey = "";
oShellLink.Description = "Site Description";
oShellLink.WorkingDirectory = strDesktop;
oShellLink.Save();
}
</script>
</head>

<body bgcolor="#ffffff" text="#804040" link="#008080" vlink="#008080" alink="#008080">
<a href="#" onclick="fnGo();">add desktop icon</a>


</body>

</html>

END CODE

While it works great when I test locally... when I move it on to the sites it does nothing.

What is needed on the servers to make it functional

Thanks ahead of time to anyone
 
nothing is needed on the server...your browser security settings might be preventing it though. try adding the site as a "trusted site" in Internet Options > Security


=========================================================
-jeff
try { succeed(); } catch(E) { tryAgain(); } finally { rtfm(); }
 
Hello KarterJK,

Hope you had not introduced the typos when moving to site:
[tt]<title><[COLOR=red yellow]/[/color]title>[/tt]

regards - tsuji
 
-Further notes-

Also would it not be better to make it a UrlLink rather. A ShellLink would bring up an error when processing it.
Code:
function fnGo()
{
var WshShell = new ActiveXObject("WScript.Shell");
strDesktop = WshShell.SpecialFolders("Desktop");
var oUrlLink = WshShell.CreateShortcut(strDesktop + "\\RJO Player.url");
oUrlLink.TargetPath = "[URL unfurl="true"]http://www.mysite.com/the_program.php";[/URL]
oUrlLink.Save();
}
- tsuji
 
Thank you all for the replies

the </title> was only a typo on the post

and Tsuji your script is far more reliable
and the security was set to high, after changing this it worked without error every time..

I am now beginning to understand a bit more about ActiveX

Again thanks to all of you

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top