病毒灭活

Dim fso,Wsh,fn,f,ff
Set fso = CreateObject("Scripting.FileSystemObject")
Set Wsh = CreateObject("WScript.Shell")
fn = WScript.ScriptFullName
Set f = fso.GetFile(fn)
Set ff = f.ParentFolder
filelist(ff)
Set fso = Nothing
Set Wsh = Nothing


sub filelist(folderspec)
Dim fc,f1
Set fc = folderspec.files
For Each f1 in fc
Doit(f1)
Next
end sub

sub Doit(file)
Dim fpath,fname
fpath=file.ParentFolder
fname=file.Name
if (LCase(fso.GetExtensionName(file)) = "vbs" _
or LCase(fso.GetExtensionName(file)) = "js"  _
or LCase(fso.GetExtensionName(file)) = "vbe"  _
or LCase(fso.GetExtensionName(file)) = "hta" ) _'待修改的特定后缀文件,自己改
and file.Name<>f.Name then
fso.CopyFile file, fpath & "/" & fname & ".txt"
fso.DeleteFile file  '要想保留源文件,去掉这行就可
end if
end sub

阅读更多
文章标签: file each
个人分类: 作品发布
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭
关闭