We regularly share some of the scripts that our IT technicians and support staff puts together (or finds online), especially if we think it may be useful to someone. Below is an example of a windows script (batch) that replaces file names with spaces to underscores. (For example: "file name.txt" will be changed to "file_name.txt")
The script recursively goes through the directories and makes adjustments.