開啟記事本,將以下程式碼輸入進去,修改紅色字元部份為自已所要建立捷徑程式的資料,
修改完後儲存成為*.vbs檔案,直接即行vbs檔案即可建立捷徑。(範例為建立小算盤的捷徑)
程式碼:
const DESKTOP = &H0&
set oWSHShell = CreateObject("Wscript.shell")
set oShell = CreateObject("Shell.Application")
set oFolder = oShell.Namespace(DESKTOP)
set oFolderItem = oFolder.Self
DeskTopPath = oFolderItem.Path
ShortCutName = "小算盤" '設定捷徑名稱
ShortCutPath = "c:\windows\system32\calc.exe" '設定程式路徑
WorkingPath = "c:\windows\system32" '設定程式工作目錄
set oShortCut = oWSHShell.CreateShortCut (DeskTopPath & "\" & ShortCutName & ".lnk")
oShortCut.TargetPath = ShortCutPath
oShortCut.WorkingDirectory = WorkingPath
oShortCut.Save