Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CopyFolder permission denied error 1

Status
Not open for further replies.

Muddmuse

Programmer
Jul 31, 2001
85
US
Could someone explain the process of copying folders? I have a folder with read-only files in it that I want to copy to a new location. The first time is fine but when I re-copy over an existing folder I get the permission denied error because the files already exist and are read-only. Do I need to loop thru each file and set it to remove the read-only attribute or can I somehow do that on the folder level? If you could provide a code sample that would be much appreciated.
 
How about something like this .....

Private Sub Command1_Click()
Shell "attrib -r -h -s c:\myfolder\*.*"
End Sub

This will remove the read only, hidden, and system attributes from the files in myfolder.
 
vbrocks,
Muddmuse may not have given you a star but I found this very useful

Thanks
Scoty ::)

"Learn from others' mistakes. You could not live long enough to make them all yourself."
-- Hyman George Rickover (1900-86),
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top