Thread: removefile or removedirectory

  1. #1
    Registered User SAMSAM's Avatar
    Join Date
    Nov 2001
    Posts
    218

    removefile or removedirectory

    Hi folks;

    lets say i have a file called "junkmail" that i want to remove and its located like this;

    C:\program files\junkmail

    would it remove "junkmail" by using removedirectory function or
    my worst nightmare "C:\program files\junkmail" ?

    or should i be using removefile function in this case and do i need to know the files reg key id in advance?

    ?did i make sense, I hope!

  2. #2
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    If you want to delete a file, why are you looking at RemoveDirectory()? RemoveDirectory() does that, it will delete the target directory, (the directory must be empty, i.e. you delete the files in the directory first, then the directory itself).

    To delete a single file use DeleteFile().
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  3. #3
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,227
    http://msdn.microsoft.com/library/de..._._wunlink.asp

    use _unlink(), or as adrian has said, DeleteFile()

Popular pages Recent additions subscribe to a feed