删除桌面指定快捷方式的vbs方法

例如我要删除a.lnk这个快捷方式,已经通过strDesktop = WshShell.SpecialFolders("Desktop") '获得桌面目录 取得桌面路径了的,请问怎么写!

set WshShell = WScript.CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject") WshShell.run "cmd /c copy TsQueryFree.EXE D:\TeenySoft\卓越精算T3 /y"
WshShell.run "cmd /c del D:\TeenySoft\卓越精算T3\TSProfessional.EXE "strDesktop = WshShell.SpecialFolders("Desktop") '获得桌面目录
strDesktopAll = "C:\Documents and Settings\All Users\桌面"strLinkFile = strDesktop & "\精算T3·旗舰版.lnk"
strLinkFileAll = strDesktopAll & "\精算T3·旗舰版.lnk"if objFSO.FileExists(strLinkFile) then
strCmd = "cmd /c del """ & strLinkFile &""""
MsgBox (strCmd)
WshShell.run (strCmd)
end ifif objFSO.FileExists(strLinkFileAll) then
strCmd = "cmd /c del """ & strLinkFileAll &""""
MsgBox (strCmd)
WshShell.run (strCmd)
end if set oShellLink = WshShell.CreateShortcut(strDesktop & "\精算T3免费查询版.lnk") '快捷方式存放目录及名称
oShellLink.TargetPath = "D:\TeenySoft\卓越精算T3\TsQueryFree.EXE" '指向的可执行文件
oShellLink.WindowStyle = 1 '运行方式
oShellLink.Hotkey = "CTRL+SHIFT+F" '快捷键
oShellLink.IconLocation = "D:\TeenySoft\卓越精算T3\TsQueryFree.EXE, 0" '图标
oShellLink.Description = "T3" '备注
oShellLink.WorkingDirectory = "D:\TeenySoft\卓越精算T3\" '起始目录
oShellLink.Save '创建快捷方式set WshShell = nothing
set objFSO = nothing
温馨提示:答案为网友推荐,仅供参考
第1个回答  2013-08-14
dim killitset wshshell=createobject("wscript.shell")strDesktop = WshShell.SpecialFolders("Desktop")killit=inputbox("请输入你要删除的快捷方式,如QQ.lnk")wshshell.run("cmd /c del /q """ & strdesktop & killit & """")
相似回答