Ask Question Forum:
Model Library:2025-02-08:A.I. model is online auto reply
C
O
M
P
U
T
E
R
2
8
Show
#
ASK
RECENT
←
- Underline
- Bold
- Italic
- Indent
- Step
- Bullet
- Quote
- Cut
- Copy
- Paste
- Table
- Spelling
- Find & Replace
- Undo
- Redo
- Link
- Attach
- Clear
- Code
Below area will not be traslated by Google,you can input code or other languages
Hint:If find spelling error, You need to correct it,1 by 1 or ignore it (code area won't be checked).
X-position of the mouse cursor
Y-position of the mouse cursor
Y-position of the mouse cursor
Testcursor
caretPos
Attachment:===
Asked by Knowledgeable
at 2024-07-26 19:53:51
Point:500 Replies:3 POST_ID:829125USER_ID:11978
Topic:
Windows 7;Microsoft Operating Systems;Microsoft Windows Operating Systems
I sometimes need to rename a group of files such as 39-1.docx, 39-2.docx, 39-3.docx, 39-4.docx, 39-5.docx, & 39-6.docx
so that all of these files will have another character after the last character of the file name such as b.
That would rename all of the files listed above to 39-1b.docx, 39-2b.docx, 39-3b.docx, 39-4b.docx, 39-5b.docx, & 39-6b.docx.
What is the correct command line command to do this from the Windows command line?
so that all of these files will have another character after the last character of the file name such as b.
That would rename all of the files listed above to 39-1b.docx, 39-2b.docx, 39-3b.docx, 39-4b.docx, 39-5b.docx, & 39-6b.docx.
What is the correct command line command to do this from the Windows command line?
Accepted Solution
Expert: Bryce Ahler replied at 2024-07-27 14:09:34
166 points EXCELLENT
Hello,
From a Windows command line you can use the command REN or RENAME with a wildcard to add the b.
All files must be in the same directory.
For example:
From WIndows run CMD
Once in command line, CD<directory> (this is the name of where your files are saved)
Once in the directory, REN 39-*.docx 39-*b.docx (the star will find all files that match the preceding string and allow for the same beginning name info plus add the b)
From a Windows command line you can use the command REN or RENAME with a wildcard to add the b.
All files must be in the same directory.
For example:
From WIndows run CMD
Once in command line, CD<directory> (this is the name of where your files are saved)
Once in the directory, REN 39-*.docx 39-*b.docx (the star will find all files that match the preceding string and allow for the same beginning name info plus add the b)
Assisted Solution
Expert: duncanb7 replied at 2024-07-26 22:31:42
167 points EXCELLENT
You can try this code for all files such as input file string="39-1.docx 39-2.docx 39-3.docx"
Duncan
Duncan
@echo offsetlocal enableextensions enabledelayedexpansionset string=39-1.docx 39-2.docx 39-3.docxfor %%x in (%string%) do (echo ===================for /F "tokens=1* delims=." %%a in ("%%x") do rename %%x %%ab.%%b) 1:2:3:4:5:6:7:8:
Assisted Solution
Expert: duncanb7 replied at 2024-07-26 21:17:04
167 points EXCELLENT
You can start it as example for 39-1.docx
Duncan
Duncan
@echo offsetlocal enabledelayedexpansionset file=39-1.docxfor /F "tokens=1* delims=." %%a in ("%file%") do set a=%%afor /F "tokens=2* delims=." %%a in ("%file%") do set b=b.%%aecho %a%echo %b%echo %a%%b%rename %file% %a%%b% 1:2:3:4:5:6:7:8:9: