my batch skills are somewhat rusty and I've been fumbling around for hours finding out how to glue those parts together, but no way.
(Checking DtTutoFunctions.php, didn't get me further.)
I'd like to use the function :toCamelCase combined with a simple For loop to rename files with uppercase filenames.
Before: ANY FILE.DAT, OTHER_ONE ...
After: AnyFile.dat, Otherone ...
So basically, what I want to do is referencing :toCamelCase from within a For loop which iterates through all matching directory entries:
Code: Select all
@echo off
For /f "tokens=*" %%i in ('dir /a:-d /b %MyDir% ^| findstr /v "[abcdefghijklmnopqrstuvwxyz]"') do (
set "s=%%~i"
REM Now what's missing is some sort of statement
REM that allows saving the return value of :toCamelCase
REM in a new variable for further use:
ren "%%~i" %ret_val
)
:toCamelCase str -- converts a string to camel case
:: -- str [in,out] - valref of string variable to be converted
[...]
Now what's the missing line in the above code that will do this?
I have no clue how to get the return value of :toCamelCase into a variable (this example seems to work, though).
Any enlightening help will be appreciated! Thanks in advance.