PDA

View Full Version : Desktop shortcut w/ icon to a webpage


futameca
10-09-2002, 07:37 PM
Is there any way to have a user click on a link that then installs (automatically?) a shortcut to thier computer desktop with a corresponding icon?

zoobie
10-09-2002, 07:47 PM
I've never heard of it...They'd probably have to d/l a small program to install this. :D

futameca
10-09-2002, 08:13 PM
Thank you sir, maybe someone else has some input and we'll all learn somthing new. I'll have to talk to our programming guys here and see what they can pull out of there little mouses. :thumbsup:

PauletteB
10-09-2002, 09:30 PM
Win ME has a royalty-free script which does that.

C:\WINDOWS\SAMPLES\WSH\SHORTCUT.JS

If you don't have it, I'll post it in a follow-up.

futameca
10-10-2002, 12:37 AM
Thanks Paulette,

I'm running Windows 2000 and could not find what you refered to above. If you can plop the script up here, that would be great. Is this compatible with other operating sysytems?

BTW...zoobie... if my reference to you as "Sir" was not correct, I apologize, I guess you never who might be behind the cool screen name.

Nightfire
10-10-2002, 01:00 AM
Is this the same thing you're asking about?

http://www.codingforums.com/showthread.php?s=&threadid=7566

PauletteB
10-10-2002, 01:09 AM
//SHORTCUT.JS

// Windows Script Host Sample Script
//
// ------------------------------------------------------------------------
// Copyright (C) 1996-1997 Microsoft Corporation
//
// You have a royalty-free right to use, modify, reproduce and distribute
// the Sample Application Files (and/or any modified version) in any way
// you find useful, provided that you agree that Microsoft has no warranty,
// obligations or liability for any Sample Application Files.
// ------------------------------------------------------------------------


// This sample demonstrates how to use the WSHShell object to create a shortcut
// on the desktop.
var vbOKCancel = 1;
var vbInformation = 64;
var vbCancel = 2;

var L_Welcome_MsgBox_Message_Text = "This script will create a shortcut to Notepad on your desktop.";
var L_Welcome_MsgBox_Title_Text = "Windows Scripting Host Sample";
Welcome();

// ********************************************************************************
// *
// * Shortcut related methods.
// *

var WSHShell = WScript.CreateObject("WScript.Shell");


// Read desktop path using WshSpecialFolders object
var DesktopPath = WSHShell.SpecialFolders("Desktop");

// Create a shortcut object on the desktop
var MyShortcut = WSHShell.CreateShortcut(DesktopPath + "\\Shortcut to notepad.lnk");

// Set shortcut object properties and save it
MyShortcut.TargetPath = WSHShell.ExpandEnvironmentStrings("%windir%\\notepad.exe");
MyShortcut.WorkingDirectory = WSHShell.ExpandEnvironmentStrings("%windir%");
MyShortcut.WindowStyle = 4;
MyShortcut.IconLocation = WSHShell.ExpandEnvironmentStrings("%windir%\\notepad.exe, 0");
MyShortcut.Save();

WScript.Echo("A shortcut to Notepad now exists on your Desktop.");

//////////////////////////////////////////////////////////////////////////////////
//
// Welcome
//
function Welcome() {
var WSHShell = WScript.CreateObject("WScript.Shell");
var intDoIt;

intDoIt = WSHShell.Popup(L_Welcome_MsgBox_Message_Text,
0,
L_Welcome_MsgBox_Title_Text,
vbOKCancel + vbInformation );
if (intDoIt == vbCancel) {
WScript.Quit();
}
}


M$ also has a .vbs version of the above.
All I know about the scripts is to invoke them, one clicks on the file name.

joh6nn
10-10-2002, 01:46 AM
yeah, problem is, that only works in IE, 5+, and only if you fiddle with the security settings a bit. as far as i know, there's no good, cross browser way, to make a shortcut to the website.

Nightfire
10-10-2002, 01:52 AM
I don't know javascript well, but am I right in thinking that could be modified to add stuff in people's pc's without them getting any alerts? IF it is true, hope they don't make it cross browser.

whammy
10-10-2002, 04:42 AM
Why do you think that Microsoft is always full of security holes? :D

Roy Sinclair
10-10-2002, 03:09 PM
Originally posted by Nightfire
I don't know javascript well, but am I right in thinking that could be modified to add stuff in people's pc's without them getting any alerts? IF it is true, hope they don't make it cross browser.

Actually you have to get the user to "click through" some security warnings. Of course there are a lot of users who'll just barge right through security warnings without the slightest thought...

futameca
10-10-2002, 03:52 PM
Thank You all !!!

Paulette...thanks for the script.

Nightfire...that is very much the same sort of thing, thanks.

This is great information to chew on, just hope I don't need to perform the Heimlich maneuver on myself.

My goal was to make it as easy (KISS) as possible on the user to do this (lowest common denominator users), but I may have to walk them through the other ways of doing this.

joh6nn
10-10-2002, 10:22 PM
i think it's far easier to tell your users, to drag the icon from the address bar to the desktop, than it is to walk them through changing the security settings. just my opinion, though.

futameca
10-10-2002, 11:27 PM
That's the approach I will probably take. Thanks