Computing.Net > Forums > Programming > Include two filenames together in a backup

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

Include two filenames together in a backup

Reply to Message Icon

Name: amace
Date: August 13, 2009 at 08:53:48 Pacific
OS: Windows XP
Subcategory: Batch
Tags: batch, XP, coding
Comment:

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"


and
"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 jsmith.id, and names.nsf, I'd like to output the files as jsmith.id and jsmithnames.nsf.

How would I go about combining those names?



Sponsored Link
Ads by Google

Response Number 1
Name: Razor2.3
Date: August 13, 2009 at 15:56:12 Pacific
Reply:

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")


0
Reply to Message Icon

Related Posts

See More


delete x number of lines ... Batch programming, userna...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Include two filenames together in a backup

FC command does NOT work in a batch www.computing.net/answers/programming/fc-command-does-not-work-in-a-batch/17859.html

File I/O counting number of words in a file www.computing.net/answers/programming/file-io-counting-number-of-words-in-a-file/20183.html

Simple CRC in a Batch File www.computing.net/answers/programming/simple-crc-in-a-batch-file/14997.html