国产探花免费观看_亚洲丰满少妇自慰呻吟_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



發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 阿巴嘎旗| 云霄县| 呼图壁县| 宝应县| 通榆县| 收藏| 康平县| 汶川县| 东安县| 花莲市| 三门峡市| 赤峰市| 哈巴河县| 河池市| 大方县| 丹东市| 谢通门县| 长乐市| 台山市| 体育| 衡南县| 陵川县| 长武县| 垫江县| 长泰县| 辽宁省| 荃湾区| 深圳市| 河东区| 台中市| 屏山县| 天柱县| 永济市| 阿拉善盟| 夏邑县| 日土县| 都江堰市| 斗六市| 哈密市| 石景山区| 密山市|