以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  请问怎么指定生成快捷方式的图标?  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=132251)

--  作者:q1156741089
--  发布时间:2019/3/18 10:42:00
--  请问怎么指定生成快捷方式的图标?


--  作者:q1156741089
--  发布时间:2019/3/18 10:42:00
--  
Dim wsh As object = CreateObject("WScript.Shell")
Dim str As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
Dim PathLink As String = str & "\\" & "oaexe.exe"  
If Not PathLink.ToLower.EndsWith(".lnk") Then
    PathLink = PathLink & ".lnk"
    MessageBox.Show(PathLink)
End If
Dim wshs As object = wsh.CreateShortcut(PathLink)
wshs.TargetPath = ProjectPath &  "qb.exe"   \'这里是快捷方式的指向
wshs.Save()

--  作者:有点甜
--  发布时间:2019/3/18 12:05:00
--  

Dim wsh As object = CreateObject("WScript.Shell")
Dim PathLink As String = "d:\\abcdefg.lnk"
If Not PathLink.ToLower.EndsWith(".lnk") Then
    PathLink = PathLink & ".lnk"
End If
Dim wshs As object = wsh.CreateShortcut(PathLink)
wshs.TargetPath = "c:\\"
wshs.IconLocation = "d:\\test.ico"
wshs.Save()
wshs = Nothing
wsh = Nothing


--  作者:q1156741089
--  发布时间:2019/3/18 13:00:00
--  
好的。谢谢