删除桌面指定快捷方式的vbs方法
例如我要删除a.lnk这个快捷方式,已经通过strDesktop=WshShell.SpecialFolders("Desktop")'获得桌面目录取得桌面路径了的,请问...
例如我要删除a.lnk这个快捷方式,已经通过strDesktop = WshShell.SpecialFolders("Desktop") '获得桌面目录 取得桌面路径了的,请问怎么写!
展开
2个回答
2013-08-14
展开全部
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
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
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 & """")
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询