home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 26
/
CD_ASCQ_26_1295.iso
/
vrac
/
upcsh4.zip
/
UPCEG.BAT
< prev
next >
Wrap
DOS Batch File
|
1995-05-27
|
3KB
|
98 lines
@echo off
Echo *
Echo This batch file shows you how UPCOPY works by creating a couple of
Echo temporary directories \TEMP1 and \TEMP2 with some example files
Echo and then running UPCOPY between them
Echo *
Echo ^C to stop
pause
xcopy upceg.bat \temp1\*.* > nul
xcopy upceg.bat \temp2\*.* > nul
type upcopy.doc > \temp2\upcopy.doc
copy upcopy.doc \temp1 > nul
type dc.bat > \temp1\dc.bat
copy dc.bat \temp2 > nul
Echo This is a new file in temp1 > \temp1\nt1.dat
Echo This is a new file in temp2 > \temp2\nt2.dat
if exist \temp2\nt1.dat erase \temp2\nt1.dat
if exist \temp1\nt2.dat erase \temp1\nt2.dat
@echo on
pause First directory information using upcopy/i \temp1 \temp2
upcopy/i \temp1 \temp2
@echo off
pause
@echo on
rem Next upcopy \temp1\upceg.bat \temp2\upceg.bat
pause up-to-date so nothing happens
upcopy \temp1\upceg.bat \temp2\upceg.bat
pause
rem Next just the one new file nt1.dat copied into temp2
Pause upcopy /y/f/n \temp1 \temp2
upcopy /y/f/n \temp1 \temp2
@echo off
erase \temp2\nt1.dat
@echo on
pause I've erased \temp2\nt1.dat to restore the directories
Pause Next upcopy /y/n \temp1 \temp2, that's new files both ways
upcopy /y/n \temp1 \temp2
pause
@echo off
erase \temp2\nt1.dat > nul
erase \temp1\nt2.dat > nul
@echo on
pause Erased them to restore the directories
rem Next is upcopy /y/c \temp1 \temp2
Pause The common files updated both ways
upcopy /y/c \temp1 \temp2
pause
@echo off
copy upcopy.doc \temp1 > nul
copy dc.bat \temp2 > nul
@echo on
rem Directories restored
rem This time UPCOPY will do new files asking questions, answer as you like
pause upcopy /n \temp1 \temp2
upcopy /n \temp1 \temp2
pause Erasing them to restore the directories
@echo off
erase \temp2\nt1.dat > nul
erase \temp1\nt2.dat > nul
@echo on
rem This time you can erase instead too
Pause upcopy /n/e \temp1 \temp2
upcopy /n/e \temp1 \temp2
pause Erasing and copying to restore the directories
@echo off
if exist \temp2\nt1.dat erase \temp2\nt1.dat
if exist \temp1\nt2.dat erase \temp1\nt2.dat
Echo This is a new file in temp1 > \temp1\nt1.dat
Echo This is a new file in temp2 > \temp2\nt2.dat
@echo on
rem This time you can erase, overwrite new with old, compare, quiet mode
pause upcopy /e/o/c/q \temp1 \temp2
upcopy /e/o/c/q \temp1 \temp2
Pause A directory now so you can see what happened
upcopy /i \temp1 \temp2
pause Restoring the directories
@echo off
type upcopy.doc > \temp2\upcopy.doc
copy upcopy.doc \temp1 > nul
type dc.bat > \temp1\dc.bat
copy dc.bat \temp2 > nul
Echo This is a new file in temp1 > \temp1\nt1.dat
Echo This is a new file in temp2 > \temp2\nt2.dat
if exist \temp2\nt1.dat erase \temp2\nt1.dat
if exist \temp1\nt2.dat erase \temp1\nt2.dat
@echo on
rem Standard UPCOPY to finish
pause upcopy \temp1 \temp2
upcopy \temp1 \temp2
Pause A directory now so you can see what happened
upcopy /i \temp1 \temp2
pause erasing and removing the directories
erase \temp1\*.*
rd \temp1
erase \temp2\*.*
rd \temp2