本帖最后由 jyswjjgdwtdtj 于 2023-6-12 21:12 编辑
要是效率不够还能再提(但是也没太大作用)- set s=createobject("shell.application")
- set f=s.namespace(replace(wscript.scriptfullname,wscript.scriptname,""))
- set re=new regexp
- set fso=createobject("scripting.filesystemobject")
- set info=fso.createtextfile("info.log",2,true)
- function gettext(fp)
- set a=fso.opentextfile(fp,1)
- gettext=a.readall
- a.close()
- end function
- sub writetext(fp,t)
- on error resume next
- set a=fso.createtextfile(fp,true)
- if err.number<>0 then msgbox fp:err.clear
- a.write t
- a.close()
- end sub
- re.pattern="[a-zA-Z\.\\]+\.(com|cn|cc|net|org|top|vip)[a-zA-Z\.\\]*"
- re.global=true
- call ft(f)
- sub ft(obj)
- set fs=obj.items
- fs.filter &h20,"*"
- set fi=obj.items
- fi.filter &h40,"*.txt"
- for each f in fs
- call ft(f.getfolder)
- next
- for each f in fi
- t=gettext(f.path)
- for each e in re.execute(t)
- if len(e)<6 then
- t=replace(t,e,"")
- info.writeline e
- end if
- next
- call writetext(f.path,t)
- next
- end sub
复制代码 保存为vbs 建议备份文件在运行
嗯……还是ps代码漂亮 可惜我不会 |