Wednesday, 14 August 2013

Delete complete folder using powershell script

Delete complete folder using powershell script

I am using following expression to delete a folder from poweshell. I need
to delete complete folder( including all the files and sub folders)
Remove-Item -Recurse -Force $DesFolder
But this gives me exception "The directory is not empty"
I am not getting the exception everytime I run the program. It happens
randomly. What would be the reson for this and how to fix this?
Please advise me.

No comments:

Post a Comment