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
Answers (3)
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?