fix: 生成快捷方式的vbs

This commit is contained in:
caoqianming 2023-11-16 11:36:05 +08:00
parent 90d77779cd
commit 306d457e9d
1 changed files with 27 additions and 0 deletions

27
生成快捷方式.vbs Normal file
View File

@ -0,0 +1,27 @@
' 创建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