I have a folder structure of textures, and there are at least 200 textures.
I want to replace them all with a image of a cat (=ↀωↀ=), but keep the name of the files.
Any easy way?
Batch replace keeping the name
Moderators: white, Hacker, petermad, Stefan2
Copy one file to many files in sub folder, keep target name!
Hi and welcome!
-open a DOS-Box
-go to main folder of your "folder structure"
(be SURE to be in the right folder!!!)
For example: "D:\rive\MAIN\"
- type
for /F "tokens=*" %A in ('dir /S /B') DO @echo COPY /Y "X:\path\cat.jpg" "%A"
Press the ENTER-key.
Take a look if that copy command looks fine
COPY /Y "X:\path\cat.jpg" "D:\rive\MAIN\path\texture.png"
COPY /Y "X:\path\cat.jpg" "D:\rive\MAIN\path to another\texture.png"
COPY /Y "X:\path\cat.jpg" "D:\rive\MAIN\sub folder\texture.png"
....
.....
.......
To limit to f.ex. *.png files, if necessary, change the DIR command to ('dir /S /B *.png')
If it looks fine, remove the word 'echo ' to make that command really work:
for /F "tokens=*" %A in ('dir /S /B') DO @COPY /Y "X:\path\cat.jpg" "%A"
-open a DOS-Box
-go to main folder of your "folder structure"
(be SURE to be in the right folder!!!)
For example: "D:\rive\MAIN\"
- type
for /F "tokens=*" %A in ('dir /S /B') DO @echo COPY /Y "X:\path\cat.jpg" "%A"
Press the ENTER-key.
Take a look if that copy command looks fine
COPY /Y "X:\path\cat.jpg" "D:\rive\MAIN\path\texture.png"
COPY /Y "X:\path\cat.jpg" "D:\rive\MAIN\path to another\texture.png"
COPY /Y "X:\path\cat.jpg" "D:\rive\MAIN\sub folder\texture.png"
....
.....
.......
To limit to f.ex. *.png files, if necessary, change the DIR command to ('dir /S /B *.png')
If it looks fine, remove the word 'echo ' to make that command really work:
for /F "tokens=*" %A in ('dir /S /B') DO @COPY /Y "X:\path\cat.jpg" "%A"
2steinm07
Based on Stefan2's code you can use this button to do it:
Just copy the green text above - then right click on the button bar and choose "Paste"
Mark all the files you want overwritten and then place the cursor on the file you want to use for the overwriting and click the button.
Based on Stefan2's code you can use this button to do it:
Code: Select all
TOTALCMD#BAR#DATA
%COMSPEC% /C
for /F "tokens=*" %%a in (%L) do copy /Y %P%N "%%a"
wcmicons.dll,62
Copy one file to multiple files (replace their content)
-1
Mark all the files you want overwritten and then place the cursor on the file you want to use for the overwriting and click the button.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
GREAT!
Thank you both, it worked!
Stefan2, it took me a while to figure out what you mean by "DOS-Box", i was thinking "Why the hell this guy whats me to open DOSBox?(A Dos emulator.)"
And the i realised you mean the command prompt/cmd.
KTHXBI
Stefan2, it took me a while to figure out what you mean by "DOS-Box", i was thinking "Why the hell this guy whats me to open DOSBox?(A Dos emulator.)"
And the i realised you mean the command prompt/cmd.
KTHXBI