PDA

View Full Version : command shortcut desktop


snaaps
06-03-2005, 02:43 PM
Is it possible to make a command, that creates a shortcut on the desktop of the client's computer?

I want give the option to install the cdrom on the local harddrive of the clients computer. This is no problem with 'copy folder to'.

But now we want to create a shortcut on their desktops!
The problem is: the location and name of the desktop are different on each system: 'desktop', 'bureaublad', documentsettings/user, map 'windows'

How do I solve this problem?

longedge
06-03-2005, 04:10 PM
Hello,

I have done just this several times by doing the following.

1. Create a shortcut on my own desktop. Obviously it has to be to a known folder/exe. My users have a lot of mapped drives (via network logon scripts) so when accessing network folders I have to be careful to use fully qualified UNC's.
2. Copy the resultant .lnk file into the docs folder of your project.
3. File.Copy that .lnk file to C:\Document and Settings\All Users\Desktop

It works very well.

leebos
06-07-2005, 09:14 PM
Here is the method I use to copy multiple shortcuts to the users desktop.
When my shortcuts are created they are placed in C:\yoursourcefolder\ICONS.
This way they only appear for the logged in user and not everyone.

iFolder = "C:\\yoursourcefolder";
DestFolder = Shell.GetFolder(SHF_DESKTOP);
File.Copy(iFolder.."\\ICONS\\*.*", DestFolder.."", true, true, false, true, nil);

Lee

rhosk
06-08-2005, 04:53 AM
Take a look at Shell.CreateShortcut :)

leebos
06-08-2005, 07:01 AM
Ron, I do use Shell.CreateShortcut to create the shortcuts on the "master" machine. The program CD is created on the "master" and then distributed to multiple users/machines. Some of them have multiple users on their machines and only want the icon shortcuts to show up on the desktop for the logged in user when installed.

Thanks,
Lee