Deleting directories with a space at the end

Somehow a directory on our network got a space at the end of the name. Some crazy script (in desperate need of Trim(), apparently) created it, I think. And, we were unable to view or delete that folder, since a trailing space is an invalid character for a directory.

If you find yourself in that dilemma, there’s an easy solution: your friend RMDIR. e.g. if the directory is “\myservermysharedirectorywithaspace “, use

rmdir "\myservermysharedirectorywithaspace "

You can also wipe out local directories, e.g.

rmdir "C:directorywithaspace "

0