国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網站 > IIS > 正文

清空iis log 中自己登錄ip的vbs

2024-08-29 03:13:53
字體:
來源:轉載
供稿:網友


option explicit

dim sourcefile,ipaddress,objargs

const destfile="tempfile"
const forwriting = 2

dim text
dim fso,objnet,serviceobj
dim txtstream, txtstreamout

set objargs = wscript.arguments
if objargs.count = 2 then
sourcefile=objargs(0)
ipaddress=objargs(1)
else
wscript.echo "parameter error"+ vbcrlf
wscript.echo "usage:killlog.vbs logfilename yourip."
wscript.quit 1
end if

set fso = createobject("scripting.filesystemobject")
if fso.fileexists (sourcefile) then
set objnet = wscript.createobject( "wscript.network" )
set serviceobj = getobject("winnt://" & objnet.computername & "/w3svc")
set objnet=nothing
serviceobj.stop
wscript.sleep 6000
set txtstream = fso.opentextfile(sourcefile)
set txtstreamout = fso.opentextfile(destfile, forwriting, true)
do while not (txtstream.atendofstream)
text = txtstream.readline
if instr(text,ipaddress)=0 then
txtstreamout.writeline text
end if
loop

set txtstream = nothing
set txtstreamout = nothing

wscript.echo "the log file-- " & sourcefile &" has cleaned your ip!"
else
wscript.echo "the log file-- " & sourcefile & " has not found!"
wscript.quit
end if
fso.copyfile destfile, sourcefile
fso.deletefile destfile
set fso=nothing
serviceobj.start
set serviceobj = nothing



發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 南雄市| 黄大仙区| 高邑县| 昌图县| 乌苏市| 蒲城县| 连江县| 黄梅县| 抚顺县| 简阳市| 新晃| 康保县| 安达市| 仙居县| 襄汾县| 河西区| 旅游| 洱源县| 澄迈县| 云阳县| 四川省| 淮安市| 石柱| 团风县| 普宁市| 瑞金市| 东莞市| 峡江县| 许昌市| 凌云县| 鹰潭市| 敖汉旗| 昌吉市| 大冶市| 旅游| 桐庐县| 固始县| 绵竹市| 长武县| 土默特右旗| 临泉县|