

Using Windows Explorer (Windows 7) and File Explorer (Windows 10/8 / 8.1) is probably the easiest way to batch rename multiple files on Windows. Get-ChildItem $source -Recurse -Include *.Storing technical libraries forces Windows users to find ways to manage files more efficiently, and one of the most effective solutions is to batch rename files. Just put the full path to the source and destination directories at the top between the quotation marks.Įdit: added the bit about file creation time.Įdit: added naming examples, the # is a comment, only leave one $name = uncommented at a time, if you uncomment multiple, it will be the last uncommented one that takes effect. This bit of powershell does what you want. If there's another option that can be easily scheduled through task scheduler that would work too. Powershell would also be an option but I know even less about how to do it in there. Can someone help me out? I vaguely understand what the code is doing but not enough to manipulate it into doing what I want. If there are multiple files in the directory it errors out that it can't merge multiple files into a single file (which makes sense, it can't rename all files to 1 file.īut I'm stuck. It renames it in the format I want (but uses current date and time, not sure how to use modified or created date instead) and moves it correctly.

Move "c:\test\source\*.csv" "c:\test\destination\File_%stamp%.csv" echo offįor /f "delims=" %%a in ('wmic OS Get localdatetime ^| find "."') do set dt=%%a I've pieced it together from google and it works in a fashion but doesn't do quite what I want. (I can schedule it to run multiple times a day to pick up any that weren't processed before.
