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

首頁(yè) > 編程 > VBScript > 正文

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

2020-07-26 11:56:50
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友
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

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 双辽市| 大石桥市| 龙里县| 肃宁县| 大埔县| 柳州市| 小金县| 巩留县| 德清县| 株洲市| 乐昌市| 苏尼特左旗| 塔河县| 汉川市| 务川| 民勤县| 民和| 潜江市| 铜梁县| 峡江县| 临泽县| 巧家县| 六枝特区| 阳江市| 章丘市| 蕉岭县| 乌鲁木齐县| 凤山市| 云梦县| 衡阳市| 龙川县| 晋宁县| 临高县| 东平县| 济宁市| 新化县| 武邑县| 青河县| 河池市| 南开区| 桦川县|