General discussion

Locked

Directory delete in VC++

By Hueristic ·
How do I delete a non empty directory structure? Don't forget to mention the library please.

This conversation is currently closed to new comments.

6 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Directory delete in VC++

by lastorck In reply to Directory delete in VC++

I think so:
Find all files and subdirectories using FindFirstFile,FindNextFile recursively, delete all files using DeleteFile, delete empty directories included higher using RemoveDirectory.
Of course all files must be closed and you've to get right for deleting it.
Regards

Collapse -

Directory delete in VC++

by Hueristic In reply to Directory delete in VC++

This was the method I was looking into. But I was hopeing for an Example. I don't have the time to get all this to work. The directory structure is pretty deep and my debugging time is limited. Could You either post an example code or email it to me.

Collapse -

Directory delete in VC++

by Hueristic In reply to Directory delete in VC++

I need a sample of the code.

mrk@cherry-semi.com

Collapse -

Directory delete in VC++

by lastorck In reply to Directory delete in VC++

Ofcourse you can directly call system command "del" (like "del /F /S /Q YuorPath") with CreateProcess or WinExec.
Regards

Collapse -

Directory delete in VC++

by Hueristic In reply to Directory delete in VC++

yes calling deltree from shellexecute was my next choice.

Collapse -

Directory delete in VC++

by Hueristic In reply to Directory delete in VC++
Back to Web Development Forum
6 total posts (Page 1 of 1)  

Related Discussions

Related Forums