File name too long – Error on WebLogic Portal domain removal

Sometimes you need to recreate domain or just remove the domain for good. On Windows you might end up with situation where simple recursive WebLogic domain folder delete will cause “File Name too Long” errors and one or two files out of the domain directory cannot be deleted.

The reason for this is that the complete path (including sub-directories) is longer than 256 characters. The workaround is to reduce the names of the subdirectories one-by-one until you are able to delete the whole domain directory tree. You can start with “rename AdminServer 1” etc. until you are able to remove.