In this example, we’re trying to move PDF files that have AB, BC & CD starting at the 5 character position.
EXAMPLE SCRIPT NAME: “move.bat”
REM Creates temp.txt with filenames that have AB, BC & CD
DIR /B SENT\????AB*.pdf >> C:\temp.txt
DIR /B SENT\????BC*.pdf >> C:\temp.txt
DIR /B SENT\????CD*.pdf >> C:\temp.txt
REM Copies files from temp.txt to PDF Archive
FOR /f %%a in (C:\temp.txt) do MOVE /y SENT\%%a X:\
REM Temp file clean up
DEL temp.txt
One Response to “DOS: How do I move files with a specific characters in filename”
I’m unsure where you are having your information, but good topic.
I has to spend some time learning more or understanding more.
Many thanks for excellent information I wanted this info for my mission.