Forum Discussion

Mark1's avatar
Mark1
Contributor
6 years ago

Deleting A Folder but getting an error

I am writing a method which deletes a folder from the C drive and copies in a new folder of the same name. 

This is my code:

 

Call aqFileSystem.DeleteFolder("C:\FolderName")

Call aqFileSystem.CopyFolder("C:\Folder123\FolderName", "C:\")

 

But when I run it(with the copy folder line commented out) the folder isn't deleted and I get a comment in my results log saying " An error occurred while deleting a file(folder)."

I cannot figure out what file in the folder is causing this as I am able to delete it manually just fine.