option Explicit

Dim luna, objShortcut, objEnv, document,  objWshShell
Dim strDesktopPath, strWindir, URL

Set luna = CreateObject("Lunascape2.LunascapeAPI")
Set document = luna.GetDocumentObject(luna.GetDocumentID(luna.ActiveIndex))
Set objWshShell = WScript.CreateObject("WScript.Shell")
strDesktopPath = objWshShell.SpecialFolders("Desktop")

Dim PageURL, PageTitle

PageURL = document.URL
PageTitle = document.title

Set objShortcut = objWshShell.CreateShortcut(strDesktopPath & "/" & PageTitle & ".url")
Set objEnv = objWshShell.Environment("process")

strWindir = objEnv("WINDIR")

objShortcut.TargetPath = PageURL
objShortcut.Save

luna.MessageBox("已在桌面生成快捷方式。")