$DestinationPath is where this shortcut leads to. $SourceLnk is your link name, plus where your shortcut will be placed. Now all you need to do is call the function and supply the two parameters: $SourceLnk and $DestinationPath. Copy the function and place it as part of your script. Using this function in your script is simple. Being more of a Powershell guy, I decided to convert this to a Powershell function in order to be able to reuse it as I see fit. However, I did find a way to create shortcuts using VBScript. Surprisingly, I did not find a straight forward method to accomplish this. Looking for a simple way to place a shortcut on multiple users desktops using a Powershell script lead me to tools like mklink (which creates symbolic links, but not shortcuts). Sometimes I find that simple tasks like creating a shortcut to an Application using a script are not straight forward. How to create a desktop shortcut using Powershell
0 Comments
Leave a Reply. |