-
Notifications
You must be signed in to change notification settings - Fork 147
/
create_shortcut.vbs
26 lines (22 loc) · 864 Bytes
/
create_shortcut.vbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
'在桌面上生成 GotoX 的快捷方式。
Set fso = WScript.CreateObject("Scripting.FileSystemObject")
Set objShell = WScript.CreateObject("WScript.Shell")
linkFile = objShell.SpecialFolders("Desktop") & "\GotoX.lnk"
isCreateShortcut = True
if fso.fileExists(linkFile) then
if MsgBox("快捷方式已经存在,是否覆盖?", _
vbYesNo + vbExclamation, "请确认") = vbNo then
isCreateShortcut = False
End if
End if
if isCreateShortcut then
Set link = objShell.CreateShortcut(linkFile)
jsDirectory = fso.GetFile(WScript.ScriptFullName).ParentFolder.Path
link.TargetPath = jsDirectory & "\python\python.exe"
link.Arguments = "-E -s ..\launcher\start.py"
link.WindowStyle = 7
link.IconLocation = jsDirectory & "\GotoX.ico"
link.Description = "GotoX"
link.WorkingDirectory = jsDirectory & "\python"
link.Save()
End if