I appears we have become a victim of not using the /XJ in a robocopy command, and we have ended up with a mass of nested folders.
We want to get rid of them, but we can use the normal methods of deleting with long files, as we dont have permission to delete the files, and we can seem to set the permissions all the way down as the folder name gets to big!!
Has anyone got a clever way of getting round this, i am thinking we need some sort of script to set permissions (using takeown or similar) until it hits an error, then stop and start again where it failed, so the path gets shallower every-time?
The local SYSTEM account almost always has access.
When I've run into these issues in the past I've always been a fan of using
PSExec -s cmd
and removing the files that way.If that works its a heck of a lot easier then trying to script something up. :)
You can use Robocopy. Run as an administrator:
If "c:\empty_folder" is empty, the content of "c:\problem_folder" will be deleted.