How to delete and overwrite a write-protected file?

Discussion in 'Questions (Windows Mobile)' started by Hertz, Jul 25, 2008.

  1. Hertz

    Hertz New Member

    I would like to make a copy of a file many times while a programme is running. Since this file is write-protected The first copy works but I can't owerwrite the Write-protected file at the second copying. I always receive an error message: accessing denied. The same happens when I would like to delete the file.
    I tried to solve the problem like this:

    FileCopy("C:\New.txt","C:\folder\New.txt",true)

    Thanks!
     
  2. agraham

    agraham Expert Licensed User

    Why don't you open the original for reading and write the contents to a new file which won't then be write-protected
     
  3. Hertz

    Hertz New Member

    You are right because there was a txt file in the example.
    Actually I would like to make a copy of all the files in a folder by means of a programme. These files are in different extension, for example: bmp, wav, ini etc. Some of them are write-protected and I can't change it.
     
  4. agraham

    agraham Expert Licensed User

  5. Hertz

    Hertz New Member

    Thank you! It may be the good solution but since I have used the free version for now I can't download the file. Maybe later...
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice