- 版主
- 211464
- 21164
- 13
- 258 朵
- 47817 个
- 60 个
- 263800
- 2008-12-23
|
1#
t
T
发表于 2010-01-15 10:44
|
|只看楼主
调用例子例: - 为Calc.exe创建桌面快捷方式.
- mShellLnk "计算器","c:\windows\system32\calc.exe"
复制代码如下内容做成模块即可: -
- Option Explicit
- '*************************************************************************
- '**模 块 名:ModCreateLnk
- '**说 明:创建快捷方式
- '**创 建 人:嗷嗷叫的老马
- '**日 期:2007年6月22日
- '**备 注: 紫水晶工作室 版权所有
- '** 更多模块/类模块请访问我站: http://www.m5home.com
- '**版 本:V1.0
- '*************************************************************************
- Public Sub mShellLnk(ByVal LnkName As String, ByVal FilePath As String, Optional ByVal StrArg As String, Optional ByVal IconFileIconIndex As String = vbNullString, Optional ByVal HookKey As String = "", Optional ByVal StrRemark As String = "")
- '调用说明:
- '
- 'LnkName = 快捷方式文件名,如果无路径则自动新建到桌面;无后缀名(.lnk)会自动补齐.
- 'FilePath = 目标文件名,全路径.
- 'StrArg = 参数,可选.
- 'IconFileIconIndex = 图标所在库及索引,由逗号分隔,可选.如: "c:\windows\system32\notepad.exe,0"
- 'HookKey = 热键,值未知,可选.
- 'StrRemark = 备注,可选.
- '
- Dim WshShell As Object, oShellLink As Object, strDesktop As String
- Set WshShell = CreateObject("WScript.Shell")
- strDesktop = WshShell.SpecialFolders("Desktop") '桌面路径
- If UCase(Right(LnkName, 4))
|