VBS删除快捷方式名包含某几个字符的快捷方式怎么写!

kangkanggirl 2009-08-29 09:10:09
'on error resume next
set fso=wscript.createobject("scripting.filesystemobject")
set WshShell = WScript.CreateObject("WScript.Shell")
set f=fso.getfolder(WshShell.SpecialFolders("Desktop"))
set fs=f.files
for each f1 in fs
set file=fso.getfile(f1)
if right(file.name,4)=".lnk" then
set oShellLink=WshShell.CreateShortcut(file.name)
if right(oShellLink.TargetPath,xxxxxxxx) then
fso.deletefile(file.name),true
end if
end if

next

------------------------------
上面的代码是要怎么改 用什么函数
...全文
141 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
Microogle 2009-10-03
  • 打赏
  • 举报
回复

On Error Resume Next
Set oShell = CreateObject("Shell.Application")
Set oDir = oShell.NameSpace(0) '桌面
For Each i In oDir.Items
If i.IsLink And InStr(LCase(i.Name),"aa") Then '文件名是否包含aa
'If MsgBox("是否删除" & i.Name & "?",vbYesNo) = 6 Then
i.Verbs.Item(i.Verbs.Count - 3).DoIt
'End If
End If
Next

4,007

社区成员

发帖
与我相关
我的任务
社区描述
它是一种微软环境下的轻量级的解释型语言,它使用COM组件、WMI、WSH、ADSI访问系统中的元素,对系统进行管理。
社区管理员
  • vbScript社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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