Friday, September 7, 2012

OSD call to a vbscript to create a shortcut



This call was used in a Vidyo Desktop launch OSD.  Its purpose is to create a favorite in the users IE favorites folder on the launch of the application shortcut.

It runs quickly and silently.  The variable %sft_mst% normally has the Q: value which is substituted in at runtime.

<SCRIPT TIMING="PRE" EVENT="LAUNCH" WAIT="FALSE" PROTECT="TRUE">
<HREF>wscript.exe %sft_mnt%\011016.v01\CreateFavorite\CreateFavorite.vbs</HREF>
</SCRIPT>



vbscript


'Creates a user favorite

Dim objWshShell, vFavorites, objShortcutUrl

Set objWshShell = CreateObject("WScript.Shell")

vFavorites = objWshShell.specialfolders("Favorites")
Set objShortcutUrl = objWshShell.CreateShortcut(vFavorites & "\Vidyo Conferencing.url")
objShortcutUrl.TargetPath = "http://www.thevidyoconfsite.com"
objShortcutUrl.Save