home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 26 / CD_ASCQ_26_1295.iso / vrac / upcsh4.zip / UPCEG.BAT < prev    next >
DOS Batch File  |  1995-05-27  |  3KB  |  98 lines

  1. @echo off
  2. Echo *
  3. Echo This batch file shows you how UPCOPY works by creating a couple of
  4. Echo temporary directories \TEMP1 and \TEMP2 with some example files
  5. Echo and then running UPCOPY between them
  6. Echo *
  7. Echo ^C to stop
  8. pause
  9. xcopy upceg.bat \temp1\*.* > nul
  10. xcopy upceg.bat \temp2\*.* > nul
  11. type upcopy.doc > \temp2\upcopy.doc
  12. copy upcopy.doc \temp1 > nul
  13. type dc.bat > \temp1\dc.bat
  14. copy dc.bat \temp2 > nul
  15. Echo This is a new file in temp1 > \temp1\nt1.dat
  16. Echo This is a new file in temp2 > \temp2\nt2.dat
  17. if exist \temp2\nt1.dat erase \temp2\nt1.dat
  18. if exist \temp1\nt2.dat erase \temp1\nt2.dat
  19. @echo on
  20. pause First directory information using upcopy/i \temp1 \temp2
  21. upcopy/i \temp1 \temp2
  22. @echo off
  23. pause
  24. @echo on
  25. rem Next upcopy \temp1\upceg.bat \temp2\upceg.bat
  26. pause up-to-date so nothing happens
  27. upcopy \temp1\upceg.bat \temp2\upceg.bat
  28. pause
  29. rem Next just the one new file nt1.dat copied into temp2
  30. Pause upcopy /y/f/n \temp1 \temp2
  31. upcopy /y/f/n \temp1 \temp2
  32. @echo off
  33. erase \temp2\nt1.dat
  34. @echo on
  35. pause I've erased \temp2\nt1.dat to restore the directories
  36. Pause Next upcopy /y/n \temp1 \temp2, that's new files both ways
  37. upcopy /y/n \temp1 \temp2
  38. pause
  39. @echo off
  40. erase \temp2\nt1.dat > nul
  41. erase \temp1\nt2.dat > nul
  42. @echo on
  43. pause Erased them to restore the directories
  44. rem Next is upcopy /y/c \temp1 \temp2
  45. Pause The common files updated both ways
  46. upcopy /y/c \temp1 \temp2
  47. pause
  48. @echo off
  49. copy upcopy.doc \temp1 > nul
  50. copy dc.bat \temp2 > nul
  51. @echo on
  52. rem Directories restored
  53. rem This time UPCOPY will do new files asking questions, answer as you like
  54. pause upcopy /n \temp1 \temp2
  55. upcopy /n \temp1 \temp2
  56. pause Erasing them to restore the directories
  57. @echo off
  58. erase \temp2\nt1.dat > nul
  59. erase \temp1\nt2.dat > nul
  60. @echo on
  61. rem This time you can erase instead too 
  62. Pause upcopy /n/e \temp1 \temp2
  63. upcopy /n/e \temp1 \temp2
  64. pause Erasing and copying to restore the directories
  65. @echo off
  66. if exist \temp2\nt1.dat erase \temp2\nt1.dat
  67. if exist \temp1\nt2.dat erase \temp1\nt2.dat
  68. Echo This is a new file in temp1 > \temp1\nt1.dat
  69. Echo This is a new file in temp2 > \temp2\nt2.dat
  70. @echo on
  71. rem This time you can erase, overwrite new with old, compare, quiet mode
  72. pause upcopy /e/o/c/q \temp1 \temp2
  73. upcopy /e/o/c/q \temp1 \temp2
  74. Pause A directory now so you can see what happened
  75. upcopy /i \temp1 \temp2
  76. pause Restoring the directories
  77. @echo off
  78. type upcopy.doc > \temp2\upcopy.doc
  79. copy upcopy.doc \temp1 > nul
  80. type dc.bat > \temp1\dc.bat
  81. copy dc.bat \temp2 > nul
  82. Echo This is a new file in temp1 > \temp1\nt1.dat
  83. Echo This is a new file in temp2 > \temp2\nt2.dat
  84. if exist \temp2\nt1.dat erase \temp2\nt1.dat
  85. if exist \temp1\nt2.dat erase \temp1\nt2.dat
  86. @echo on
  87. rem  Standard UPCOPY to finish
  88. pause upcopy \temp1 \temp2
  89. upcopy \temp1 \temp2
  90. Pause A directory now so you can see what happened
  91. upcopy /i \temp1 \temp2
  92. pause erasing and removing the directories
  93. erase \temp1\*.*
  94. rd \temp1
  95. erase \temp2\*.*
  96. rd \temp2
  97.  
  98.