Juvigy Posted November 9, 2009 Posted November 9, 2009 Hi Guys, I have a working VBS that i use to extract ZIP files. Set WshShell = CreateObject("Wscript.Shell") user = WshShell.ExpandEnvironmentStrings("%UserName%") strZipFile = "c:\128.zip" outFolder = "c:\" Set objShell = CreateObject( "Shell.Application" ) Set objSource = objShell.NameSpace(strZipFile).Items() Set objTarget = objShell.NameSpace(outFolder) intOptions = 256 objTarget.CopyHere objSource, intOptions The problem is that every now and then it gives me the error "The files exists" and it doesnt work anymore. I need to change the strZipFile = "c:\128.zip" for example to strZipFile = "c:\129.zip" and it starts working again. Does anybody know why?
PsaltyDS Posted November 9, 2009 Posted November 9, 2009 Sounds like the files already exist at the target. And this is not an AutoIt question... Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Juvigy Posted November 10, 2009 Author Posted November 10, 2009 Yes , but the files dont exist. I have triple checked that. I also have converted this in Autoit and it has the same behavior. I suspect that the files are first extracted to a temp location and then copied to the target location. I use the script several times a day , every day and have to update the file names 1 or 2 times per month.
omikron48 Posted November 10, 2009 Posted November 10, 2009 (edited) Why not just use the 7zip standalone and a batch file? Edited November 10, 2009 by omikron48
Juvigy Posted November 10, 2009 Author Posted November 10, 2009 I just found a solution. I noticed that my "\local settings\temp" directory is 20gb. Inside for every 128.zip file that i extracted there was a copy folder with the contents. That is why it stops working - too many directories with the same name in the folder. After "rd temp /s /q" my extract function works great again.
trancexx Posted November 10, 2009 Posted November 10, 2009 On 11/10/2009 at 8:54 AM, 'Juvigy said: I just found a solution. I noticed that my "\local settings\temp" directory is 20gb.Inside for every 128.zip file that i extracted there was a copy folder with the contents.That is why it stops working - too many directories with the same name in the folder.After "rd temp /s /q" my extract function works great again.Search forum for _ExtractZip() function. It handles that automatically.How do I know? You'll see when you find it ♡♡♡ . eMyvnE
Juvigy Posted November 10, 2009 Author Posted November 10, 2009 10x. If only you had a look at this earlier (or i searched more extensively) I just finished doing on my own what you have already done (add error checking and temp files cleaning).
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now