Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Protect Files from Copy

Status
Not open for further replies.

inforeqd

Technical User
Jan 8, 2001
95
US
I have a batch script that performs a copy of newly created files in one directory to another. I would like to set some attribute on the files (once copied) so the next time the script runs it will not duplicate the copy. Is this possible? If so how?

TIA
inforeq
 
hi inforeqd

Would using the XCOPY command with the /D parameter give you the results you're after?

The help file states:

/D:m-d-y Copies files changed on or after the specified date.If no date is given, copies only those files whose source time is newer than the destination time.

What this should do is allow you to use the switch and, if the files in your source destination are the same as in the destination, they will not be copied, but if there are new files, or the source files have been updated since the last copy, it will copy them.

If you're running the batch file manually, and there are not too many files, you could always just use the /p parameter, so you have the option not to copy individual files. Not ideal, I admit, but an option.

Hope this helps a little.

Cheers,

Chris
 
chris,

That did it .. Thanks alot. I didnt read the help on it and just assumed that it could only work with mm dd yy attributes. Thanks for pointing the rest of the help information.

Inforeq
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top