X-Received: by 10.129.104.214 with SMTP id d205mr4621207ywc.78.1480334826592; Mon, 28 Nov 2016 04:07:06 -0800 (PST) X-Received: by 10.157.11.120 with SMTP id p53mr516669otd.19.1480334826536; Mon, 28 Nov 2016 04:07:06 -0800 (PST) Path: csiph.com!weretis.net!feeder6.news.weretis.net!news.glorb.com!p16no2275069qta.1!news-out.google.com!j8ni10096qtc.0!nntp.google.com!n6no2276091qtd.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: microsoft.public.scripting.vbscript Date: Mon, 28 Nov 2016 04:07:06 -0800 (PST) In-Reply-To: <583c1289$0$21413$e4fe514c@news.xs4all.nl> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=61.12.35.115; posting-account=DEHywwoAAABxlArdHf7lIL0PyWSk9dOv NNTP-Posting-Host: 61.12.35.115 References: <272535d3-23c0-44b7-bcdf-b99ede1fad18@googlegroups.com><583be929$0$21473$e4fe514c@news.xs4all.nl> <6b6acec6-bf5a-401b-b4de-86713f6d3b95@googlegroups.com><583c0ac9$0$21397$e4fe514c@news.xs4all.nl> <74a5c05c-e698-4286-ac91-6139c6b27f4e@googlegroups.com> <583c1289$0$21413$e4fe514c@news.xs4all.nl> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <0bf6b357-ef5d-4242-992d-bca114e4810a@googlegroups.com> Subject: Re: VB Script for creating zip file and copying files into it. From: Chitra Balasubramani Injection-Date: Mon, 28 Nov 2016 12:07:06 +0000 Content-Type: text/plain; charset=UTF-8 Xref: csiph.com microsoft.public.scripting.vbscript:11438 On Monday, 28 November 2016 16:49:06 UTC+5:30, R.Wieser wrote: > Chitra, > > > I tired copying to normal folder, instead of zip. That worked fine. > > Hmmm ... > > There is one more thing you can try: Try changing > > zip.CopyHere(sourceItems) > > to > > zip.CopyHere(sourceItems.items) > > (the former will copy the foldername too, the latter only the files in that > folder) > > If that does not work you could choose to first copy the needed files to a > temporay folder (which you could create and remove in the script itself), > and from there copy them into the ZIP file. Yes, I know that that is a > work-around, but if the direct way fails you need to come up with a fix. :-) > > Regards, > Rudy Wieser > > > -- Origional message: > Chitra Balasubramani schreef in berichtnieuws > 74a5c05c-e698-4286-ac91-6139c6b27f4e@googlegroups.com... > > On Monday, 28 November 2016 16:15:31 UTC+5:30, R.Wieser wrote: > > > Chitra, > > > > > > > Tried adding sleep. Now getting "Access Denied Error" > > > > > > That seems to mean that the CopyHere is actually trying to copy some > > > file(s). :-) > > > > > > I get the feeling that you get that error because one of the files in > > > "C:\Users\chitra.balasubramani\Desktop\Mail" is still in use (is your > mail > > > program still running ? If so, close it before running the script). > > > > > > Have you tried to just copy those files to a temporary normal folder and > see > > > if you get the same error (using VBScript but also try drag-and-dropping > > > them using the file/windows explorer) ? > > > > > > Regards, > > > Rudy Wieser > > > > ... > > > > I tired copying to normal folder, instead of zip. That worked fine. Wieser, If the dest folder is "Set DestFldr=objShell.NameSpace("C:\apace-jmeter-3\bin\Results\Temp")", Copy is working. If the dest is Set DestFldr=objShell.NameSpace("C:\apace-jmeter-3\bin\Results\outcome.zip")", getting access denied error. Changed copyHere as "DestFldr.CopyHere (SrcFldr.Items)" Thanks, CHitra