Include two filenames together in a backup

August 13, 2009 at 08:53:48
Specs: Windows XP
I am trying to write a batch file that will backup a Lotus notes ID file and an address book to a server. The backup code is quite simple, just:
"xcopy "C:\Program Files\Lotus\Notes\Data\*.id" P:\Notes Backup/y"

"xcopy "C:\Program Files\Lotus\Notes\Data\names.nsf" P:\Notes Backup/y"

However, since I"ll be backing up about 100 names.nsf files, I want to include the id filename in front of the "names.nsf" so for example, if the files to backup were, and names.nsf, I'd like to output the files as and jsmithnames.nsf.

How would I go about combining those names?

See More: Include two filenames together in a backup

Report •

August 13, 2009 at 15:56:12
The untested, non-script version:
for %a in ("C:\Program Files\Lotus\Notes\Data\*.id") do (copy /y "%~Fa" "P:\Notes Backup" && copy /y "%~DPa\names.nsf" "p:\Notes\Backup\%~Na.names.nsf")

Report •
Related Solutions

Ask Question