1.

Solve : Batch file to pre-pend text to multiple filenames?

Answer»

Hi folks, from the Windows7 command line, the following command prepends "text_" to all csv files in the current directory
Code: [Select]FOR %A IN (*.csv) DO REN "%A" "test_%~nA%~XA"
e.g. 1234.csv to test_1234.csv

Question: how do you run this command from a batch file instead of directly from the command PROMPT?
Many THANKS, Pete.
Each %A must be %%A in the batch file.Also, when using variable modifiers, you can combine them so that...

%~nA%~xA

can be replaced by:

%~nxA



Discussion

No Comment Found