View Single Post
  #4  
Old 13-04-2019, 02:20
Joe Forster/STA's Avatar
Joe Forster/STA Joe Forster/STA is offline
Senior forum member
 
Join Date: Nov 2000
Location: Hungary
Posts: 9,836
Thanks: 20
Thanked 342 Times in 224 Posts
Joe Forster/STA is on a distinguished road
I think you're looking for this:
Code:
for /r %%f in (*.bk2) do arc.exe a -i2 -r -mbpk %%~dpnf.arc %%f
The variable called "%f" (if used in a .bat file, "%" must be doubled) is assigned the paths of all files matching "*.bk2" in all subdirectories, in any depth, of the current directory. After each assignment, the command after "do" is executed. The "%~dpnf" syntax splits the path in "%f" into components, keeps the "d"rive, "p"ath and "n"ame components only, and drop the e"x"tension - because you add another extension.

Run "for /?" in the command line for the complete description of the "for" command, including everything I wrote above.
__________________
Joe Forster/STA
For more information, see the FileForums forum rules and the PC Games forum FAQ!
Don't contact me via E-mail or PM to ask for help with anything other than patches (or software in general) done by me, otherwise your request may be deleted without any reply!
Homepage: http://sta.c64.org, E-mail: [email protected]; for attachments, send compressed (ZIP or RAR) files only, otherwise your E-mail will bounce back!
Reply With Quote
The Following 2 Users Say Thank You to Joe Forster/STA For This Useful Post:
shazzla (13-04-2019), Simorq (13-04-2019)