![]() I.e., you want to replace backslash \ with underscore _. REM If you remove "echo" from the next line, the copy will happen Set "trimfile=!trimfile:%RemovePath%=% %!" ![]() Set "trimfile=!File:%Pattern%=%Replace%!" Set "RemovePath=!CD:%Pattern%=%Replace%!_" It'll iterate over all matching files in the subdirectories and copy into the current (main) directory. This should do it if you run it from within your main directory. title Rename BatĪs mentions in the comments: Keep a safe copy of your original files before you run this operation! You need a backup just in case. I did see something like this somewhere else, but this would still take a lot of time. Now I don't mind if I have to copy the bat file into each folder of if some amazing person can help me out and have it in the main subject folder. \Math A\Frank Sims\Book 2 Subtraction\Math A_Subtraction Booklet_Frank Sims.docx \Math A\Frank Sims\Book 1 Addition\Math A_Addition Booklet_Frank Sims.docx \Math A\Frank Sims\Book 2 Subtraction\Subtraction Booklet.docx \Math A\Frank Sims\Book 1 Addition\Addition Booklet.docx \Math A\Jim Book\Book 2 Subtraction\Math A_Subtraction Booklet_Jim Book.docx \Math A\Jim Book\Book 1 Addition\Math A_Addition Booklet_Jim Book.docx \Math A\Jim Book\Book 2 Subtraction\Subtraction Booklet.docx doc \Math A\Jim Book\Book 1 Addition\Addition Booklet.docx ![]() I want the batch file to rename the file to what ever it was to Subject_Book#_Name.doc or. I have a subject folder and in each subject folder I have the students name, booklet they are doing in a folder and then there is the file either a. What I want to know is there a way to write a batch file to do the following: I'm a teacher and want to have all the files labelled consistently as I have to send them off. Normally I'm pretty got at finding some code I need an to manipulate it but horrible if I have to start from scratch. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |