Here is the script as of now:
Code: Select all
@echo off
setlocal enabledelayedexpansion
for /f "delims=" %%a in ( ' dir "*.png" /b /s /a-d ' ) do (
echo processing "%%a"
set "name=%%~nxa"
pushd "%%~dpa"
copy /b /y "%%a" ".\rsrc\!name:~0!"
popd
)
Here's what I'd like to hopefully have the script accomplish in one shot:
1. Create the 'rsrc' subdir under each 1st-level folder. For example, if the script is running from TOPLEVEL\ then it should create:
TOPLEVEL\subdir1\rsrc\
TOPLEVEL\subdir2\rsrc\
TOPLEVEL\subdir2\randomfolder\ (this folder would not get a 'rsrc' subdir because it's 2 levels down)
I'm currently using a separate batch to accomplish this prior to running the script above, but it would be nice to fold it into the same script:
Code: Select all
@echo off
pushd .\
FOR /F "delims=" %%G in ('dir /ad /b') do mkdir "%%G\rsrc"
popd
2. Copy not only PNG files but JPG also, or whatever formats I need for that specific pass.
3. Rename the target files, while copying, from the starting extension to a dummy extension, to hide them from a graphics editor. For example, if the starting image is:
TOPLEVEL\subdir1\ImageFile.PNG
the resulting file should be:
TOPLEVEL\subdir1\rsrc\ImageFile.TEMP
I have all this running as separate scripts and I've documented my workflow so I can do this all pretty quickly, but it would be nice to fold it all into a single script if possible, if someone would be kind enough to help...
m1