fix: 生成快捷方式的vbs
This commit is contained in:
parent
90d77779cd
commit
306d457e9d
|
@ -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
|
Loading…
Reference in New Issue