Many directly include all the files on the server Program , Images and other files are encapsulated into mdb, and the following file is required.
Dim RS, WS, FSO, Conn, stream, connstr, thefolder
Set rs = Createobject ("ADODB. recordset ")
Set stream = Createobject ("ADODB. Stream ")
Set conn = Createobject ("ADODB. Connection ")
Set FSO = Createobject ("scripting. FileSystemObject ")
Dbname = inputbox ("Enter the database name. The database must be in the same directory as the program", "Mc package and decompress the script ")
Connstr = "provider = Microsoft. Jet. oledb.4.0; Data Source =" & dbname &";"
Conn. Open connstr
Rs. Open "select * from [filedata]", Conn, 1, 1
Stream. Open
Stream. type = 1
On Error resume next
Do until Rs. EOF
Thefolder = left (RS ("path"), faster Rev (RS ("path "),"\"))
If FSO. folderexists (thefolder) = false then
Createfolder (thefolder)
End if
Stream. seteos ()
Stream. Write RS ("file ")
Stream. savetofile STR & RS ("path"), 2
Rs. movenext
Loop
Rs. Close
Conn. Close
Stream. Close
Set Ws = nothing
Set rs = nothing
Set stream = nothing
Set conn = nothing
Wscript. Echo "all files have been released! "
Sub createfolder (PATH)
Dim I
I = instr (path ,"\")
Do while I> 0
If FSO. folderexists (left (path, I) = false then
FSO. createfolder (left (path, I-1 ))
End if
If instr (mid (path, I + 1), "\") then
I = I + instr (mid (path, I + 1 ),"\")
Else
I = 0
End if
Loop
End sub