
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-28-2015 05:02 PM
How do you create a command to drop a shortcut on the current logged on user's desktop under the deployment options?
Solved! Go to Solution.
Labels:
- Labels:
-
General Discussion
1 ACCEPTED SOLUTION

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-28-2015 08:12 PM
I'm sure there are several ways to accomplish this task. We elected to use a powershell script to create the desktop shortcut since we can specify items such as the target path and extra arguments/switches. Needing to set the details of the shortcut to our specific install was what required the custom desktop shortcut.
We placed the ps script in the package and call it with the a Command action in the deployment and after the application is installed.
The PS script itself is pretty short & sweet for a ps script....
We placed the ps script in the package and call it with the a Command action in the deployment and after the application is installed.
powershell.exe -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -Command {PackageShare}\Installers\PATH TO YOUR PACKAGE\MakeLnk.ps1
The PS script itself is pretty short & sweet for a ps script....
# Create Shortcut with modified Target Directory
#$DesktopPath = [Environment]::GetFolderPath("Desktop")
$DesktopPath = 'C:\Users\Public\Desktop'
$WshShell = New-Object -ComObject WScript.Shell
$Shortcut = $WshShell.CreateShortcut("$DesktopPath\NAME OF SHORTCUT HERE.lnk")
$Shortcut.TargetPath = "C:\Program Files (x86)\PATH TO\YOUR APPLICATION\YOUR FILE.exe"
$Shortcut.Arguments = 'YOUR TARGET COMMAND LINE ARGUMENTS (SWITCHES) GO HERE'
$Shortcut.Save()
2 REPLIES 2

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-28-2015 08:12 PM
I'm sure there are several ways to accomplish this task. We elected to use a powershell script to create the desktop shortcut since we can specify items such as the target path and extra arguments/switches. Needing to set the details of the shortcut to our specific install was what required the custom desktop shortcut.
We placed the ps script in the package and call it with the a Command action in the deployment and after the application is installed.
The PS script itself is pretty short & sweet for a ps script....
We placed the ps script in the package and call it with the a Command action in the deployment and after the application is installed.
powershell.exe -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -Command {PackageShare}\Installers\PATH TO YOUR PACKAGE\MakeLnk.ps1
The PS script itself is pretty short & sweet for a ps script....
# Create Shortcut with modified Target Directory
#$DesktopPath = [Environment]::GetFolderPath("Desktop")
$DesktopPath = 'C:\Users\Public\Desktop'
$WshShell = New-Object -ComObject WScript.Shell
$Shortcut = $WshShell.CreateShortcut("$DesktopPath\NAME OF SHORTCUT HERE.lnk")
$Shortcut.TargetPath = "C:\Program Files (x86)\PATH TO\YOUR APPLICATION\YOUR FILE.exe"
$Shortcut.Arguments = 'YOUR TARGET COMMAND LINE ARGUMENTS (SWITCHES) GO HERE'
$Shortcut.Save()
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-28-2015 07:53 PM
use example from Upgrade LSpush on how to copy file using the provided scripts.. just create shortcut and copy to c:\users\public\Desktop on target computer.
