title: Batch or Bash to remove a timestamp in thousands of files
body: <p>I made a major mistake today in handling my selfhosted backup system and wound up deleting about half of my user folder. Luckily, the backup existed and was able to copy all of my data over. The bad part is each file that was restored has a timestamp in the filename.</p>
  
  <p>So a file that was filename.file is now filename~20170401-1999.file</p>
  
  <p>I'm not too bright when it comes to batch files or what not, but is there any way a BAT could be programmed to run through every single filename and take out the timestamp? Every single timestamp starts with the ~ and ends with the period of the filetype. So removing everything including and after the tilde and stopping at the character before the period would fix the problem.</p>
  
  <p>There are some 4600 files needing fixed with a wide variety of filetype extensions. I am on Windows 10 Pro and able to user powershell or bash to fix the error. I have the Windows Linux Subsystem installed, so a bash script is also acceptable.</p>