cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to Create a Desktop Shortcut?

Hi All,

Very new user of Admin Studio (first day)... I thought I would try something simple to get started. 😉

Desktop Shortcut:

Using our old method of package creation and software deployment, I would create a package that would copy over a .VBS script and a .ICO file to a folder (that is created during the process) to the target workstation. Once on the target workstation, my package would then trigger my script to create the desktop shortcut and associate the .ICO I specified with it.

Alas - I'm not quite sure what I'm missing. Using AdminStudio, my test package creates the folder and copies the .VBS script and .ICO over to the target workstation... but the script never runs. I've created a custom action with the script - but NADA... If I go to the created directory on the target and double click my script - it works perfectly, so I must be missing how to trigger the script in AdminStudio (or perhaps I have it triggered at the wrong place).

Any thoughts for a newbie? Any help or suggestions would be greatly appreciated. Even better - if there is better way to do desktop shortcuts - clue me in!

Tony
(6) Replies
Alpesh
By
Flexera Alumni
Hi Tony,

In your script, try changing the working directory to the folder containing the script. This may help.

Thanks!
Creating Desktop Shortcuts for an existing application or a shortcut to an exe within your MSI?
Alpesh wrote:
Hi Tony,

In your script, try changing the working directory to the folder containing the script. This may help.

Thanks!


Thank you for your reply. I do have the script referencing the folder and it's contents. The AdminStudio package also references the folder for the location.
jaybee96 wrote:
Creating Desktop Shortcuts for an existing application or a shortcut to an exe within your MSI?


In this case - a web shortcut using a custom .ICO.

Here is the script I normally use:

Dim oFso
Dim oWSHShell
Dim oShortcut, DesktopPath

Set oWSHShell = WScript.CreateObject("WScript.Shell")
Set oFso = CreateObject("Scripting.FileSystemObject")

'Read desktop path using WshSpecialFolders object
DesktopPath = oWSHShell.SpecialFolders("AllUsersDesktop")

' Create a shortcut object on the desktop
Set oShortcut = oWSHShell.CreateShortcut(DesktopPath & "\Name of Shortcut.lnk")

' Set shortcut object properties and save it
oShortcut.TargetPath = "http://some_web_site"
oShortcut.IconLocation = "C:\Deploy\fod\fod.ico"
oShortcut.Save

'Clean Up
Set oWSHShell = nothing
Set oFso = nothing
Run your script (custom action) deferred, in system context, right before "install finalize"
Mistral wrote:
Run your script (custom action) deferred, in system context, right before "install finalize"


Thanks for the reply. I made the modifications and it still didn't work... but I did come across this from a Google Search and it worked without any need for doing the VBS script...

http://kb.flexerasoftware.com/selfservice/viewContent.do?externalID=Q105380

Quick and easy desktop shortcut pointing towards a internet resource. Thanks to everyone who tried to help!