1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Open each file in a directory and check corrupted files

Discussion in 'MFC' started by Member12, Jul 8, 2010.

  1. Member12

    Member12 New Member

    Jul 8, 2010
    Likes Received:
    Trophy Points:

    I have a directory which contains all types of files(.doc,.xls,.pdf,.txt,.msg,.xml,.html etc...) and the number files increases day by day. Some files might have been corrupted in the directory and they will not open whenever i try to open. It just shows an error message saying file cannot be opened.

    Now i need to write a program to open each file in the directory and close it. Whenever a file doesn't opens, i need to take the file name and store it in a log file or a stack. At the end of the day i will have the file names which are corrupted.

    I am able to open the files but could not close them. Please help me how do i close each file and take the files names which did not open....

Share This Page