How to remove a folder and all its contents
-
Hi to all, I know it is a stupid question, but I couldn't find any function that deletes a directory and all its contents. I've tried to use
Directory.Remove()
but for some reason my compiler does not recogniseSystem
as a valid namespace. Thanks for the help -
Hi to all, I know it is a stupid question, but I couldn't find any function that deletes a directory and all its contents. I've tried to use
Directory.Remove()
but for some reason my compiler does not recogniseSystem
as a valid namespace. Thanks for the helpAre you sure that is a
Visual C++ / MFC
question? :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke -
Are you sure that is a
Visual C++ / MFC
question? :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke -
:confused: Well... I would thought so, as I want to do it programmatically in my C++ application. Am I wrong?
System
namespace belongs to the.NET Framework
. See [^]. :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke -
Hi to all, I know it is a stupid question, but I couldn't find any function that deletes a directory and all its contents. I've tried to use
Directory.Remove()
but for some reason my compiler does not recogniseSystem
as a valid namespace. Thanks for the helpYou can delete any directory using
RemoveDirectory()
function, provided that the directory which is being deleted is empty. So, you will first have to delete all the files of the directory (by usingDeleteFile()
function) and then useRemoveDirectory()
to delete it.Regards, Vijay.
-
System
namespace belongs to the.NET Framework
. See [^]. :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke -
Hi to all, I know it is a stupid question, but I couldn't find any function that deletes a directory and all its contents. I've tried to use
Directory.Remove()
but for some reason my compiler does not recogniseSystem
as a valid namespace. Thanks for the helpYou could try this: http://bobmoore.mvps.org/Win32/w32tip28.htm[^]
-
Hi to all, I know it is a stupid question, but I couldn't find any function that deletes a directory and all its contents. I've tried to use
Directory.Remove()
but for some reason my compiler does not recogniseSystem
as a valid namespace. Thanks for the helppiul wrote:
I know it is a stupid question, but I couldn't find any function that deletes a directory and all its contents.
Use
SHFileOperation()
."Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
Hi to all, I know it is a stupid question, but I couldn't find any function that deletes a directory and all its contents. I've tried to use
Directory.Remove()
but for some reason my compiler does not recogniseSystem
as a valid namespace. Thanks for the helpusing SYSTEM.IO; can help
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
Never mind - my own stupidity is the source of every "problem" - Mixturecheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You