Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Ok 1st thanks to Chris for my help the other day...
Now...I have a batch which copies files for backup onto CD, what I want is for if the file is the SAME (i.e. no changes made to that file since last backed up on CD) then to not copy it over...Is this possible?
Ian

Sorry need to add to it:::
If the disk is full then prompt for another and to continue
OR
ZIP the files so they will all fit (LONG SGOT THIS ONE I THINK!)

Ian wrote:
> If the disk is full then prompt
> for another and to continueXCOPY.EXE will return an errorlevel greater than zero if an error occurs, such as if the disk is full. The exact errorlevel for such error is 5, but I think you could jut check if it's 1 or greater, since that means something is wrong.
:copy
XCOPY c:\file.dat d:\
if not errorlevel=1 goto copyOK
echo.
echo Error occurred, probably out of disk
echo space (see error message above). If
echo so, replace the disk ant hit any key
echo to continue. To terminate batch job,
echo hit CTRL+BREAK.
pause > nul
goto copy> ZIP the files so they will all
> fit (LONG SGOT THIS ONE I THINK!)Get PKZIP.EXE, avaliable on download.com. It's a command-line compressor (makes .zip files).
About you first problem, I couldn't think of any _direct_ solution (such as a switch on XCOPY). If no one turns up with such solution, I can make a work-around with batch.
-- Leonardo Pignataro - Secret_Doom --
secret_doom@hotmail.com
www.batch.hpg.com.br

Just use the wonderfull command called XCOPY with the option /D
this option will only copy newer files, and it can handle subdirs and even systemfiles ...
soo much stuff the regular 'explorer' in windows STILL cant do
xcopy /?
for help at command line

Yes, that could be a good way. Though that's not what he asked for (he wanted to copy only if the file is different, not if it is newer), perhaps that's not what he actually meant.
The only difference here is that the /D switch will copy two files which are different but "saved" in different dates -- no big deal. Good work, Miskva.
-- Leonardo Pignataro - Secret_Doom --
secret_doom@hotmail.com
www.batch.hpg.com.br

Can u help me with this question?
"If the user specifies file extensions, only files which match the extensions will be backed up. Adding extensions to the command line is optional. The user should be able to type any number of extensions, up to the 127 character limit of the Dos command line."
What command can i use to do this Backup file.
Thanx 4 helping.

![]() |
deleting udeletable files
|
DOS database on a Netware...
|

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