Good day. I'm trying to write a Windows batch file to backup photos from my drive E: to drives H: and J: while creating a separate log file for each backup operation. I thought that this would be a good time to learn about FOR loops. So far I have:
for %%s in (h, j) do (
echo Backing up to: %%s
set %%BuLog%%=filenane-%%s.log
echo %BuLog%
)
With the set statement I am trying to create a filename for the log file. The above does not work. It wants to create the same filename in booth passes. I am looking for 'filename-h.log' and 'filename-j.log.
I have tried different arrangements of % and %%, quoting, mild swears, and Googling. Thanks!