个人随笔和一些网文摘录
http://www.dlxp.cn

VBS创建桌面快捷方式

近段时间学习VBS,配合教程作了一个小脚本.留作记号

Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oShell = CreateObject("Wscript.Shell")
If rtnVal = vbYES Then
	sDesktop = oShell.SpecialFolders("Desktop")
	set oShellLink1 = oShell.CreateShortcut(sDesktop & "\HtaEdit.lnk")
	oShellLink1.TargetPath = Chr(34)& sCurDir & "\Htaedit.exe" & Chr(34)
	oShellLink1.WorkingDirectory = Chr(34)& sCurDir & Chr(34)
	oShellLink1.Save
	set oShellLink2 = oShell.CreateShortcut(sDesktop & "\VbsEdit.lnk")
	oShellLink2.TargetPath = Chr(34)& sCurDir & "\Vbsedit.exe" & Chr(34)
	oShellLink2.WorkingDirectory = Chr(34) & sCurDir & Chr(34)
	oShellLink2.Save
End If

如果有错误,请大侠们指点.

未经允许不得转载:Leejoa's 生活随笔 » VBS创建桌面快捷方式
分享到: 更多 (0)

评论 抢沙发

评论前必须登录!