/build/static/layout/Breadcrumb_cap_w.png

How to create shortcut to .exe on users desktop

Hi all,

This is what I would like to achieve.  I have an application that I need to deploy and I have managed to do this.  This application does not have an install sequence as such, but is just a folder with a bunch of files and one is the .exe in question.

I want to be able to create a shortcut to the exe and place it on the users desktop.  As this will be a staged deployment it may need a "if file exsists" type command I would think.  If am wrong about this, then so be it ..

I hope that this is enough information


0 Comments   [ + ] Show comments

Answers (3)

Answer Summary:
Posted by: rick07 9 years ago
Orange Belt
3

This is another suggestion which I use and that is create the shortcut to the exe file on your computer to the correct location you have set it. Bundle it up with the program and when it is deployed copy it to the C:\Users\Public\Desktop.

Posted by: LBarclay 9 years ago
Orange Senior Belt
2

This should work if I have understood you correctly. 

Create a .bat file and use the following code:

:CheckForFiles
IF EXIST "C:\Path_to_your_files\" (GOTO INSTALLED) ELSE (GOTO END):INSTALLED
cscript.exe "path_to_makeshortcut.vbs"
GOTO END:END
exit

 

Then create a file called "makeshortcut.vbs" and paste the following in:

Set oWS = WScript.CreateObject("WScript.Shell")
userProfile = oWS.ExpandEnvironmentStrings( "%userprofile%" )
sLinkFile = userProfile + "\Desktop\YourFileName.lnk"
Set oLink = oWS.CreateShortcut(sLinkFile)
    oLink.TargetPath = "path_to_file_location"
oLink.Save
 

The section in the vbs that should be edited are the "path_to_original_file_location" and "path_your_working_from". 

 

Put that into KACE as a script and you should be good to go from there!

 

Does that help?

Posted by: StockTrader 9 years ago
Red Belt
1

Hello,

 

It is possible to create programmatically a shortcut using vbscript using the CreateShortcut method of the Wscript.shell object.

You can have a look to this article that contains some examples:

http://support.microsoft.com/kb/244677

Kind regards,

Marco - StockTrader 

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ