Newsgroups: microsoft.public.scripting.vbscript
From: "Pegasus [MVP]" <n...@microsoft.com>
Date: Thu, 5 Nov 2009 07:57:15 +0100
Local: Thurs, Nov 5 2009 6:57 am
Subject: Re: Problem with recursion and objfolder.size
news:A199E020-3C43-4FF0-8023-F170B091547D@microsoft.com...
> 1l The purpose of the following script is to return attributes of It helps to see things more clearly if you add a little more structure to > subfolders > into an Excel spread sheet. The way it is now, it only gives the > attirbutes > for the root folder. I know I need to add a for...next. I just don't > know > what to put after the for. > 2. I get a permissions error with the objfolderf.size line, but not with > Any suggestions please? > -------------------------------- > 'Section 1 - Excel Stuff > intRow = 2 > objExcel.Cells(1, 1).Value = "Date Created" > 'Section 2 - Find folder Attributes > Set objFSO = CreateObject("Scripting.FileSystemObject") > 'For each objFolder in objFSO.GetFolder > objExcel.Cells(intRow, 1).Value = objFolder.DateCreated > 'Next your code. The script below should emphasizes the recursive component of your code. Its core is the subroutine "ProcessFolder". You first call it with the root folder name "f:\jeremy-data", then from within itself with the name of each subfolder that exists. Set objFSO = CreateObject("Scripting.FileSystemObject") Sub ProcessFolder(sFolderName) Sub DoExcelStuff (objFolder) You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||