Thread: Folder removing for an uninstaller

  1. #1
    Unregistered
    Guest

    Folder removing for an uninstaller

    Um, i am sort of new at the whole file usae thing,and I need some help. I am trying to m ake an uninstaller type program that will remove the program i made. I want the whole folder to be gone. Is there a way I can do this? I know how to use the remove command, but how do I delete the entire folder not just asingle file. Help please!! !

  2. #2
    I'm Back
    Join Date
    Dec 2001
    Posts
    556
    theres a rmdir command in dir.h but it needs the directory to be empty plus there is the system()
    -

  3. #3
    Registered User
    Join Date
    Aug 2001
    Posts
    52
    Review header files: io.h, direct.h, and windows.h. Study up on findfirst(), findnext(), struct finddata_t, removedirectory(), deletefile(), remove(), and rmdir().

    Then write a routine that takes a path, e.g., c:\myProgramFolder\*.*, searches the path for all files and subdirectories, outputs file's name and deletes the file. Then, after all files are deleted, the routine backs out of the target directory and deletes it, then returns. As subdirectories are encountered, they are entered, searched, files deleted, and exited.

    Nothing to it!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Reading .dat files from a folder in current directory...
    By porsche911nfs in forum C++ Programming
    Replies: 7
    Last Post: 04-04-2009, 09:52 PM
  2. read only folder on Windows
    By George2 in forum Windows Programming
    Replies: 2
    Last Post: 11-05-2007, 09:18 AM
  3. Hiding a folder
    By nextstep in forum Windows Programming
    Replies: 16
    Last Post: 03-20-2005, 03:07 PM
  4. removing an unwanted system folder
    By EvenFlow in forum A Brief History of Cprogramming.com
    Replies: 7
    Last Post: 10-22-2001, 03:04 AM
  5. removing contents of a folder
    By face_master in forum C++ Programming
    Replies: 2
    Last Post: 09-17-2001, 05:02 AM