Computing.Net > Forums > Disk Operating System > More batch help

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

More batch help

Reply to Message Icon

Name: Ian
Date: August 29, 2002 at 11:46:07 Pacific
Comment:

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



Sponsored Link
Ads by Google

Response Number 1
Name: Ian
Date: August 29, 2002 at 11:50:35 Pacific
Reply:

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


0

Response Number 2
Name: Secret_Doom
Date: August 29, 2002 at 17:07:31 Pacific
Reply:

Ian wrote:
> If the disk is full then prompt
> for another and to continue

XCOPY.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


0

Response Number 3
Name: Miskva
Date: August 30, 2002 at 03:36:22 Pacific
Reply:

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


0

Response Number 4
Name: Secret_Doom
Date: August 30, 2002 at 11:40:58 Pacific
Reply:

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


0

Response Number 5
Name: Nga Tran
Date: September 7, 2002 at 10:36:46 Pacific
Reply:

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.


0

Related Posts

See More



Sponsored Link
Ads by Google
Reply to Message Icon

deleting udeletable files DOS database on a Netware...



Post Locked

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


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: More batch help

Batch Help www.computing.net/answers/dos/batch-help/364.html

More Batch File Help www.computing.net/answers/dos/more-batch-file-help/9499.html

'smart' FTP batch help www.computing.net/answers/dos/smart-ftp-batch-help/11611.html