- 论坛徽章:
- 0
|
比如
Dim myShell,fso,f,ff\r\nSet myShell=Wscript.CreateObject(\"Wscript.Shell\" \r\nlogpath = \"c:\\winnt\\system32\\logfiles\\w3svc1\"\r\n\r\nyer = right(year(date()),2)\r\nmon1=month(date())\r\nif len(mon1)=1 then mon1 = \"0\" & mon1\r\nmon2=month(date()-45)\r\n\r\nif len(mon2)=1 then mon2 = \"0\" & mon2\r\nfilename = \"nc\" & yer & mon1 & \".log\"\r\noldlog = \"nc\" & yer & mon2 & \".log\"\r\nmyShell.Run \"webalizer \" & logpath & \"\\\" & filename\r\n\r\nSet fso = CreateObject(\"Scripting.FileSystemObject\" \r\nIf fso.FileExists(logpath & \"\\\" & oldlog) Then\r\nmyShell.Run \"del \" & logpath & \"\\\" & oldlog\r\nEnd If |
|