FileCopy and read-only

  • Thread starter Thread starter Dkline
  • Start date Start date
D

Dkline

I'm using FileCopy to copy a number of files off the servers onto my C:
drive. Everything works fine except for the one file that is read-only. Any
way to persuade FileCopy to copy over that file even if it is a read-only?
 
I just tested it, and it copied a read-only file just fine (as I expected).
Sure there is not some other problem in the code?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Sub test()
Dim src$, dst$
src$ = "c:\test.txt"
dst$ = "c:\test1.txt"
If GetAttr(dst$) And vbReadOnly Then
SetAttr dst$, vbNormal
End If
FileCopy src$, dst$
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top