28 lines
711 B
Plaintext
28 lines
711 B
Plaintext
|
|
' 创建Shell对象
|
|
Set objShell = CreateObject("WScript.Shell")
|
|
|
|
' 获取脚本所在文件夹路径
|
|
strScriptFolder = objShell.CurrentDirectory
|
|
|
|
' 获取桌面路径
|
|
strDesktop = objShell.SpecialFolders("Desktop")
|
|
|
|
' 创建快捷方式对象
|
|
Set objShortcut = objShell.CreateShortcut(strDesktop & "\CBMA.lnk")
|
|
|
|
' 设置快捷方式的目标路径为脚本本身
|
|
objShortcut.TargetPath = strScriptFolder & "\start.vbs"
|
|
|
|
' 设置快捷方式的图标路径为脚本所在文件夹下的favicon.ico
|
|
objShortcut.IconLocation = strScriptFolder & "\favicon.ico"
|
|
|
|
objShortcut.WorkingDirectory = strScriptFolder
|
|
|
|
' 保存快捷方式
|
|
objShortcut.Save
|
|
|
|
' 释放对象
|
|
Set objShortcut = Nothing
|
|
Set objShell = Nothing
|