批处理批量修改文件的问题

来源:百度知道 编辑:UC知道 时间:2024/06/07 15:04:44
由于中病毒,所有想用批处理搜索出电脑里所有的.html 的文件并把文件最后的 一段代码去掉.
有高手指点下怎么写 谢谢了!

将以下内容保存为vbs文件。将你所有的.html文件拖到这个vbs文件上会弹出对话框。替换你字符串。

'on error resume next
set arg=WScript.Arguments
if arg.count=0 then
msgbox "Usage:"&vbcrlf&vbcrlf&" 不要直接运行这个脚本,把需要进行字符串替换的一个或多个文件拖曳到这个脚本文件上来就可以了。",,"批量文件字符串替换器 By 有脑分析"
wscript.quit
end if
do
content1=inputbox("请输入你要替换的字符串","批量文件字符串替换器")
if isempty(content1) then
respond=msgbox("EXIT?",1)
if respond=1 then
wscript.quit
end if
elseif content1<>"" then
exit do
end if
msgbox "你没有输入你要替换的字符串呀!",,"批量文件字符串替换器"
loop
do
content2=inputbox("想把"""&content1&"""替换成什么呀?","批量文件字符串替换器")
if isempty(content2) then
respond=msgbox("EXIT?",1)
if respond=1 then
wscript.quit
end if
else
exit do
end if
loop
set fso=cre