set fso=wscript.createobject("scripting.filesystemobject")
set wshshell=createobject("wscript.shell")
Set op=fso.OpenTextFile("e:\a.txt",1,ture) '读取文件
If Not op.AtEndOfStream Then t = Split(op.ReadAll, vbCrLf) '分割字符串
op.close
t(13)=date '用当前日期替换t(13),即文件第十四行
wj=join(t,vbcrlf)
Set op=fso.OpenTextFile("e:\a.txt",2,True) '写入文件
op.write wj
op.close
以上代码关键是在于一行一行地读取文件,然后改变某一行的值再重新写入该文件。
需要知道你a.txt文件的格式,加我百度hi传过来我帮你看看。