请问怎样通过桌面快捷方式得到程序的安装路径

daewoo 2005-04-20 02:05:38
怎样通过lnk文件得到这个程序的安装路径?怎样得到一个程序的安装路径?谢谢!
...全文
149 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
tmran 2005-04-22
  • 打赏
  • 举报
回复
Mark
yinweihong 2005-04-22
  • 打赏
  • 举报
回复
那还是看VB安装盘上的shelllnk例子吧
daewoo 2005-04-20
  • 打赏
  • 举报
回复
只有这一段代码好像还不能得到程序的安装目录?
yinweihong 2005-04-20
  • 打赏
  • 举报
回复
参考:
blog.csdn.net/yinweihong getlnkparth
yinweihong 2005-04-20
  • 打赏
  • 举报
回复
简单一点的,如果你只是要得到路径的话:
Function GetTargetPath(ByVal LinkName As String)
On Local Error Resume Next
Dim Obj As Object
Set Obj = CreateObject("WScript.Shell")

Dim Shortcut As Object
Set Shortcut = Obj.CreateShortcut(LinkName)
GetTargetPath = Shortcut.TargetPath
Shortcut.Save

End Function

留下些什么 2005-04-20
  • 打赏
  • 举报
回复
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
TechnoFantasy 2005-04-20
  • 打赏
  • 举报
回复
Getting the Correct Filename for a Shortcut:
http://www.vbaccelerator.com/home/VB/Code/Libraries/Shell_Projects/Shortcut_Filename/article.asp
留下些什么 2005-04-20
  • 打赏
  • 举报
回复
注册表

7,759

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧