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

首頁 > 編程 > ASP > 正文

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

2024-05-04 10:58:55
字體:
來源:轉載
供稿:網友
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

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 嘉荫县| 澄城县| 新乐市| 县级市| 友谊县| 仙居县| 额济纳旗| 旅游| 鹤壁市| 恭城| 周宁县| 吉首市| 锦屏县| 延边| 海淀区| 和硕县| 湘潭县| 中卫市| 清新县| 湖州市| 高平市| 呈贡县| 梁河县| 淮安市| 巴彦淖尔市| 友谊县| 冷水江市| 陕西省| 巴林左旗| 咸丰县| 普格县| 庆阳市| 陇南市| 光泽县| 宁德市| 华坪县| 米易县| 丰台区| 行唐县| 彰化市| 汾阳市|