[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

FSO - CopyFile method w/Wild char - prob read-only attrib

Posted on 1999-01-25
2
Medium Priority
?
643 Views
Last Modified: 2008-02-01
I am using FSO's CopyFile method to copy multiple files (e.g.: A:\*.*) with the 'Force' = "True" (destination not important).  Users are allowed to copy files more than once.

Problem is that when trying to recopy files with "Read-Only" attrib, system comes up with err#70.  I can fix that with getattr and setattr IF I KNOW WHAT THE FILENAME IS.  Since I am using *.* as source with FSO, how do I get the filename it had a problem with.

If this can't be done using wild char (*.*), how else can I get the file list so I can copy one at a time?
0
Comment
Question by:mcb123
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 2

Accepted Solution

by:
VBDesigns earned 300 total points
ID: 1470560
Build the filelist something like this (note using a Dir() retrieves the next file name matching the wildcard):

Dim sFile as String
Dim iLoop as Integer
ReDim sFiles(0) as String

sFile=Dir("c:\*.*")
Do
    sFiles(Ubound(sFiles)) = sFile
    Redim Preserve sFiles(Ubound(sFiles)+1) as String
    sFile = Dir()
Loop while sFile<>""

' Now we have the list of all files in that dir
for iLoop = 0 to (Ubound(sFiles) - 1)
     ' Do your GetAttr and SetAttr here!
Next
0
 

Author Comment

by:mcb123
ID: 1470561
Thanks for your help.  I appreciate the fast response.

To handle the subfolders, I plan to use the recursive method - do you know if that would be the fastest method to do it?

My whole plan is to copy the entire content of a drive to another location and update a table with what was copied (file names with path info).

Thanks again for your help.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question