Just wondering if anyone can help me. Normally I'm pretty got at finding some code I need an to manipulate it but horrible if I have to start from scratch.
I'm a teacher and want to have all the files labelled consistently as I have to send them off.
What I want to know is there a way to write a batch file to do the following:
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 .doc or .docx.
I want the batch file to rename the file to what ever it was to Subject_Book#_Name.doc or .docx
My Documents/Subject/Student/Book 1/.doc
Math AJim BookBook 1 AdditionAddition Booklet.docx
Math AJim BookBook 2 SubtractionSubtraction Booklet.docx
Into
Math AJim BookBook 1 AdditionMath A_Addition Booklet_Jim Book.docx
Math AJim BookBook 2 SubtractionMath A_Subtraction Booklet_Jim Book.docx
Math AFrank SimsBook 1 AdditionAddition Booklet.docx
Math AFrank SimsBook 2 SubtractionSubtraction Booklet.docx
Into
Math AFrank SimsBook 1 AdditionMath A_Addition Booklet_Frank Sims.docx
Math AFrank SimsBook 2 SubtractionMath A_Subtraction Booklet_Frank Sims.docx
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.
I did see something like this somewhere else, but this would still take a lot of time.
title Rename Bat
echo This bat must be in the folder that
echo contains the files to be renamed.
echo Enter File Name
set /p old=
echo Enter New Name
set /p new=
ren "%old%" "%new%"
echo Done
pause```
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…