"Todd Vargo" <tlvargo@xxxxxx> wrote in message
> Paul Randall wrote:
>> I'm having trouble seeing hidden files with
>> I'm running WXP SP2 with default folder view properties set to display
>> hidden files and folders and NOT hide protected operating system files.
>> Folder view shows hidden and system files.
>> What changes should I make to my script so the Items collection will
>> hidden items, so that I can use the shell folder's CopyHere method to
>> those files to a .ZIP file?
> Add this to the end of your script.
> Dim f,fc,f1
> Set f = objfso.GetFolder(sFolderPath)
> Set fc = f.Files
> For Each f1 in fc
> WScript.Echo f1.path
I knew that FSO can see hidden files, but I was so fixated on
shell.application folder items that I neglected to look at the documentation
for the CopyHere method, which allows specifying full paths or items. For
my current application, all the files I want to zip are in a single folder.
So I can use CopyHere to copy the entire items collection, then scan the
source folder for hidden files and folders, and pass their FSO full paths to
the CopyHere method one at a time. Besides making the code more
complicated, I think it may slow down the process because each use of the
CopyHere method (I'm guessing) causes a rewrite of the entire zip file. It
would be nice if I could get an entire folder's contents zipped with a
single CopyHere using the standard tools included with WXP Home.
I tried one other thing: putting the unhidden folder of things I want zipped
inside an unhidden folder, and using my script to zip the contents of that
outer unhidden folder. It has no problem with folder items containing
hidden things. This creates an extra folder level in the zip file but gets
the job done with a single CopyHere.