/build/static/layout/Breadcrumb_cap_w.png

Creating a SendTo Shortcut through MSI

If you want to create a SendTo shortcut through MSI, then if you just add the shortcut in MSI in SendTo folder, it will not work. Even if you get the shortcut there in every user profile, still it will not work. To make a SendTo shortcut, you need to create it on the fly, which means that shortcut should be created from original exe. To solve this issue for one of my application, WinSCP, I wrote the below VBScript and placed it in %ALLUSERPROFILE%\WinSCP folder. Then I created an Active setup to call this VBScript.


Set Shell = CreateObject("WScript.Shell")

ShortcutPath = Shell.SpecialFolders("SendTo")

Set link = Shell.CreateShortcut(ShortcutPath & "\WinSCP (for upload).lnk")

link.Arguments = "/upload"

link.Description = "WinScp"

link.HotKey = ""

link.IconLocation = "C:\Program Files (x86)\WinSCP\WinSCP.exe,0"

link.TargetPath = "C:\Program Files (x86)\WinSCP\WinSCP.exe"

link.WindowStyle = 3

link.WorkingDirectory = "C:\Program Files (x86)\WinSCP"

link.Save

 

To delete this SendTo shortcut, I wrote another script and added an active setup registry key through CA during Remove sequence to run this script.

dim filesys

Set filesys = CreateObject("Scripting.FileSystemObject")

Set oShell = CreateObject("WScript.Shell")

sup = oShell.ExpandEnvironmentStrings ("%APPDATA%")

WinSCPlnk= sup & "\Microsoft\Windows\SendTo\WinSCP (for upload).lnk"

If filesys.FileExists(WinSCPlnk) Then

filesys.DeleteFile WinSCPlnk

End If

Also remember to make the above component as permanent, because you do not want to delete this vbs file at uninstall of application.

 

For more such posts, visit my blog: http://msiworld.blogspot.com


Comments

This post is locked

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login
Post

Related Posts

Share

 
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