我想问问大家这行有没有错,怎么改?

hunanchina 2004-10-21 05:28:16
我想问问大家这行有没有错,怎么改?

ws.run('d:/dumpel.exe /s \\lixuenong /l "+logarray[l]+" /f "+netdrive+"\\\\"+c+"-"+logmonth+"-"+logday()+"-"+logarray[l]+".log /d 1',0,"TRUE")}

多谢了!非常之急

全文如下:

month=new Array(12)
month[1]="一月"
month[2]="二月"
month[3]="三月"
month[4]="四月"
month[5]="五月"
month[6]="六月"
month[7]="七月"
month[8]="八月"
month[9]="九月"
month[10]="十月"
month[11]="十一月"
month[12]="十二月"

days=new Array(7)
days[1]="星期日"
days[2]="星期一"
days[3]="星期二"
days[4]="星期三"
days[5]="星期四"
days[6]="星期五"
days[7]="星期六"
function theData(aDate)
{
var currentday=days[aDate.getDay()+1]
var currentmonth=month[aDate.getMonth()+1]
return currentday+","+currentmonth+","+aDate.getDate()
}
var result;result=0
var ws=WScript.CreateObject("WScript.shell")
c=ws.expandenvironmentstrings("%computername%")
netdrive="\\\\date\\backup"

today=new Date()
var logday=today.getDate()
var logmonth=today.getMonth()

logarray=new Array(2)
logarray[0]="system"
logarray[1]="application"
logarray[2]="security"
for (l in logarray) {
ws.run('d:/dumpel.exe /s \\lixuenong /l "+logarray[l]+" /f "+netdrive+"\\\\"+c+"-"+logmonth+"-"+logday()+"-"+logarray[l]+".log /d 1',0,"TRUE")}


//ws.run('d:/dumpel.exe /s \\\\lixuenong /l "+logarray[l]+" /f "+netdrive+"\\\\"+c+"-"+logmonth+"-"+logday()+"-"+logarray[l]+".log /d 1',0,"TRUE")}
ForReading=1
ForAppending=8


for (l in logarray) {

var fs=new ActiveXObject("scripting.FileSystemObject")

var f=fs.opentextfile(""+netdrive+"\\\\"+c+"-"+month+"-"+day()+"-"+logarray[l]+".log',ForReading,"TRUE")

//var f=fs.opentextfile('d:/"+netdrive+"\\\\"+c+"-"+logmonth+"-"+logday()+"-"+logarray[l]+".log',ForReading,"TRUE")

//var f=fs.opentextfile('d:/abcd.log' ,ForReading,"TRUE")

fContents=f.ReadAll()
f.Close()


//var f=fs.OpenTextFile(""+netdrive+"\\\\"+c+"-"+logmonth+"-"+logday()+"-"+logarray[l]+".htm",ForAppending,"TRUE")

var f=fs.OpenTextFile('d:/sina.htm',ForReading,"TRUE")

fHeader="<html><head><title>Daily "
fHeader+=logarray[l]
fHeader+=c
fHeader+="</title></head>"
fHeader+="<body bgcolor=#ffffff text=#000000>"
fHeader+="<h1>daily"
fHeader+=logarray[l]
fHeader+=" log report for "
fHeader+=c
fHeader+="</h1>"
fHeader+="<h3>"


fHeader+=theData(today)

fHeader+="</h3>"
fHeader+="<pre>"

f.Write(fHeader)
f.Write(fContents)

fFooter="</pre></body></html>"

f.Write(fFooter)
f.Close()
}
...全文
22 点赞 收藏 回复
写回复
回复
切换为时间正序
请发表友善的回复…
发表回复

还没有回复,快来抢沙发~

发动态
发帖子
Web 开发
创建于2007-09-28

7.9w+

社区成员

Java Web 开发
申请成为版主
社区公告
暂无公告