title: How to replace all spaces by underscores in all file and folder names recursively in a directory tree?
body: <p>There is <a href="https://stackoverflow.com/questions/20791264/">How to replace all spaces by underscores in all file names of a folder?</a><br>
  It contains solutions to rename all files in a folder with one or more spaces in file name by replacing the spaces by underscores.</p>
  
  <p>How do I recursively rename the whole path including every directory name of that file rather than only the file name itself?</p>
  
  <p>For example the current directory is <code>C:\example</code> and it contains:</p>
  
  <pre><code>C:\example\some stupid file path with whitespace\my file.exe
  C:\example\another stupid whitespaced dir\another file.exe
  </code></pre>
  
  <p>The folders and files should be renamed to:</p>
  
  <pre><code>C:\example\some_stupid_file_path_with_whitespace\my_file.exe
  C:\example\another_stupid_whitespaced_dir\another_file.exe
  </code></pre>
  
  <p>How can this recursive file and folder renames be done?</p>