file - vbscript zip large folder -
i have written script backup data directory of our tm1 cube system..
the script creates new foldder , copies files across (excluding files\ folders). works fine.
the script zips new folder. seems fail after around 10 minutes.
around 2000 objects being backed up, including cube files 3gb in size. total around 7gb before zipping.
i have been testing on c drive full copy of files , structure backed up.. creates around 350 objects inc of cube files in zip , fails.
error: object required: 'namespace(...)'
any ideas ?
here script...
' http://stackoverflow.com/questions/15139761/zip-a-folder-up ' archivefolder "e:\tm1dev9\backups\friday.zip", "e:\tm1dev9\backups\friday" ' ***** varialbles set ****** ' strweekday = weekday(now())-1 strsourcefolder = "c:\temp\tm1\ziptesting\tm1_data" ' not use backslash @ end strdestfolder = "c:\temp\tm1\ziptesting\day" & strweekday ' not use backslash @ end strexclude = "c:\temp\tm1\ziptesting\excludelist.txt" strzipfile = "c:\temp\tm1\ziptesting\day" & strweekday & ".zip" dim fso dim objshell dim blnfinished set fso = createobject("scripting.filesystemobject") set objshell = createobject("wscript.shell") copyfiles wscript.sleep 2000 archivefolder strzipfile, strdestfolder ' copy contents on backup folder excluding items in 'excludelist.txt' sub copyfiles() if fso.folderexists(strdestfolder) fso.deletefolder strdestfolder end if if fso.fileexists (strzipfile) fso.deletefolder strzipfile end if objshell.run "xcopy " & strsourcefolder & "\*.* " & chr(34) & strdestfolder & "\*.*" & chr(34) & " /d /e /c /g /h /r /y /exclude:" & strexclude , 1, true end sub ' create zip file backup folder, delete backup folder sub archivefolder (zipfile, sfolder) createobject("scripting.filesystemobject") zipfile = .getabsolutepathname(zipfile) sfolder = .getabsolutepathname(sfolder) .createtextfile(zipfile, true) .write chr(80) & chr(75) & chr(5) & chr(6) & string(18, chr(0)) end end wscript.sleep 2000 createobject("shell.application") .namespace(zipfile).copyhere .namespace(sfolder).items until .namespace(zipfile).items.count = _ .namespace(sfolder).items.count wscript.sleep 1000 loop end 'wscript.sleep 1000 if fso.folderexists(strdestfolder) fso.deletefolder strdestfolder end if end sub
Comments
Post a Comment