首页 实地培训 VIP专区 文章中心 下载中心 精品动画 安全服务 安全产品 企业文化
技术论坛
 -->开创网络首先基于以学员为中心的人性化教学方式。以案例式教学、互动式教学为主线。
 
  当前位置: 首页 > VIP专区 > VIP文章 > 脚本攻防 >
 
 
清空iis log 中自己登录ip的vbs
发布者ID:3 作者: 发布时间:2008-05-26 06:20:32 来源: 点击:
 
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  


 
 
 
 
   
 
   
     
  • 课堂实景
  • 课程体系
  • 培训课程
  • 学费介绍
  • 巧用mstsc命令登录到console的方法
  • 课程介绍
  • 团队介绍
  • Linkideo免费Vpn
  • 就业前景
  • 汇款方式
  •  
     
     
    无标题文档
    一流开创网一流开创网一流开创网一流开创网一流开创网一流开创网一流开创网
      关于我们 | 联系方法 | 招聘信息 | 加入会员 | 诚征代理 | 广告服务 | 欢迎投稿 | 友情链接  
      版权所有:吉林省开创科技信息有限公司  
      服务热线:0431-84714442
    Copyright 2001 - 2007 All Rights Reserved