Asp file directory and file copy, which I used when writing a system upgrade, is to make the files in the current folder under the system directory, replace the old files
Sub fs ()
Set fsobject = server. CreateObject ("scripting. filesystemobject ")
End sub
Sub install ()
Call fs ()
Set folder = fsobject. getfolder (server. mappath ("."))
Response. write ("<B> Installation documentation is complete, Installation of the following documents </B> <br> ")
For each fd in folder. files
Fname = server. MapPath ("./" & fd. name)
Path2 = server. MapPath ("../" & fd. name)
For B = 0 to 20
Response. flush ()
Next
Call copyfiles (fname, path2)
For s = 0 to 10
Response. flush ()
Next
Next
End sub
Sub copyfiles (path, path2)
Set mycopy = fsobject. getfile (path)
Response. flush ()
Mycopy. copy path2
Response. write ("<B> installed success! & Nbsp; </B> "& path2 &" <br> ")
Response. Flush ()
End sub
It takes time to call.
Call install ()
Call append ()
Response. Flush ()
That's all.
Original article: reprinted, please note: www.111cn.net