javascript/vbscript to create short cut
javascript version (only workable in IE)
function create_shortcut_to_outlook_folder(){
var $this=$(window.event.srcElement);
entryID_folder= $this.attr("entryID")
folder_to= $this.attr("folder_to")
var WshShell = new ActiveXObject("WScript.Shell")
var filename= folder_to + "\\outlook folder.lnk"
var oShellLink = WshShell.CreateShortcut(filename)
with(oShellLink){
TargetPath = "\\\\mtklip01.mediatek.inc\\Public\\go2outlook_folder.vbs"
Arguments= entryID_folder
WindowStyle = 1
//'oShellLink.IconLocation = "圖示檔案"
//'oShellLink.Description = "捷徑的註解說明"
WorkingDirectory = "\\\\mtklip01.mediatek.inc\\Public"
Save()
alert("short cut was created:\r\n" + filename)
}
}
vbscript version [source]
set WshShell = WScript.CreateObject("WScript.Shell" )
strDesktop = WshShell.SpecialFolders("AllUsersDesktop" )
set oShellLink = WshShell.CreateShortcut(strDesktop & "\捷徑檔案名稱.lnk" )
oShellLink.TargetPath = "執行檔案名稱"
oShellLink.WindowStyle = 1
oShellLink.IconLocation = "圖示檔案"
oShellLink.Description = "捷徑的註解說明"
oShellLink.WorkingDirectory = "工作路徑"
oShellLink.Save