home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-386-Vol-2of3.iso / c / clone1_1.zip / CLONE.B2C < prev    next >
Text File  |  1993-01-07  |  18KB  |  513 lines

  1. echo off
  2. if "%1"==".entry2" goto entry2
  3. if "%1"==".sub1" goto sub1
  4. if "%1"==".sub2" goto sub2
  5. if "%1"==".sub3" goto sub3
  6. if "%2"==".sub4" goto sub4
  7. if "%2"==".sub5" goto sub5
  8. if "%1"==".sub6" goto sub6
  9. if "%1"==".sub7" goto sub7
  10.  
  11. echo CLONE vs. 1.1 sends a complete drive, or a part of it (branch) serially to
  12. echo another machine into a specific subdirectory. (c) 1993, Jim Groeneveld, NL
  13. echo.
  14. rem Necessary auxiliary files: SUBST.*, FIND.* (DOS) and DISK.COM, ZIP.COM (vs. 1.51);
  15. if "%1"=="" goto help
  16. if "%1"=="?" goto help
  17. if "%1"=="/?" goto help
  18. if "%1"=="-?" goto help
  19. if "%1"=="/h" goto help
  20. if "%1"=="/H" goto help
  21. echo Wait.............processing arguments..................
  22. REM The two 'FOR' lines below activate a bug in the BATch compiler if wildcards
  23. REM are specified. Their function has been reprogrammed differently.
  24. REM Compiler: BAT2EXEC 1.5 (c) 1990, 1991 Ziff Communications Co.
  25. REM           PC Magazine ■ Douglas Boling.
  26. REM for %%a in (%1 %2 %3 %4 %5 %6 %7 %8 %9) do if "%%a"==".s" goto repeat_1
  27. REM for %%a in (%1 %2 %3 %4 %5 %6 %7 %8 %9) do if "%%a"==".S" goto repeat_1
  28. for %%a in (s S) do if "%1"==".%%a" goto repeat_1
  29. for %%a in (s S) do if "%2"==".%%a" goto repeat_1
  30. for %%a in (s S) do if "%3"==".%%a" goto repeat_1
  31. for %%a in (s S) do if "%4"==".%%a" goto repeat_1
  32. for %%a in (s S) do if "%5"==".%%a" goto repeat_1
  33. for %%a in (s S) do if "%6"==".%%a" goto repeat_1
  34. for %%a in (s S) do if "%7"==".%%a" goto repeat_1
  35. for %%a in (s S) do if "%8"==".%%a" goto repeat_1
  36. for %%a in (s S) do if "%9"==".%%a" goto repeat_1
  37. goto chk_tmp
  38.  
  39. :repeat_1
  40. %0 .sub1 %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
  41. goto exit       rem never pass here!
  42.  
  43. :entry2
  44. shift
  45. shift
  46. if "%1"=="" goto help
  47. goto no_filspec
  48.  
  49. :chk_tmp
  50. if not exist $dirlist.bat goto no_dirlist
  51.   echo *** Temporary file $DIRLIST.BAT already exists, cannot proceed;
  52.   echo     remove or rename $DIRLIST.BAT or specify '.s' option.
  53.   goto end
  54. :no_dirlist
  55. if not exist $ziplist.bat goto no_ziplist
  56.   echo *** Temporary file $ZIPLIST.BAT already exists, cannot proceed;
  57.   echo     remove or rename $ZIPLIST.BAT or specify '.s' option.
  58.   goto end
  59. :no_ziplist
  60. if not exist $fillist.bat goto no_fillist
  61.   echo *** Temporary file $FILLIST.BAT already exists, cannot proceed;
  62.   echo     remove or rename $FILLIST.BAT or specify '.s' option.
  63.   goto end
  64. :no_fillist
  65. if not exist $filspec.bat goto no_filspec
  66.   echo *** Temporary file $FILSPEC.BAT already exists, cannot proceed;
  67.   echo     remove or rename $FILSPEC.BAT or specify '.s' option.
  68.   goto end
  69.  
  70. :no_filspec
  71. if exist $dirlist.bat del $dirlist.bat
  72. if exist $dirlist.bat goto $dirlist
  73. if exist $ziplist.bat del $ziplist.bat
  74. if exist $ziplist.bat goto $ziplist
  75. if exist $fillist.bat del $fillist.bat
  76. if exist $fillist.bat goto $fillist
  77. if exist $filspec.bat del $filspec.bat
  78. if exist $filspec.bat goto $filspec
  79.  
  80. rem Search %2 for file specification: a. empty
  81. if "%2"=="" goto nofilespec
  82. rem Exclude all possible legal parameters (see file UNDOCU'D.DOS)
  83. for %%a in (d D s S) do if "%2"==".%%a" goto nofilespec
  84. for %%a in (p P n N e E t T 1 2 3 4) do if "%2"=="/%%a" goto nofilespec
  85. for %%a in (b115200 b57600 b38400 b19200 b9600 b4800 b2400) do if "%2"=="/%%a" goto nofilespec
  86. for %%a in (B115200 B57600 B38400 B19200 B9600 B4800 B2400) do if "%2"=="/%%a" goto nofilespec
  87. for %%a in (b11520 b5760 b3840 b1920 b960 b480 b240) do if "%2"=="/%%a" goto nofilespec
  88. for %%a in (B11520 B5760 B3840 B1920 B960 B480 B240) do if "%2"=="/%%a" goto nofilespec
  89. for %%a in (b1152 b576 b384 b192 b96 b48 b24) do if "%2"=="/%%a" goto nofilespec
  90. for %%a in (B1152 B576 B384 B192 B96 B48 B24) do if "%2"=="/%%a" goto nofilespec
  91. for %%a in (b115 b11 b57 b38 b19 B115 B11 B57 B38 B19) do if "%2"=="/%%a" goto nofilespec
  92.  
  93. :file_spec
  94. rem if "%1"=="\" goto error1         These subst path specifications appear to
  95. rem if "%1"=="." goto error1         work correctly, as does any relative path
  96. rem if "%1"==".." goto error1        specification, at least with DOS 3.3 .
  97. for %%a in (a b c d e f g h i j k l m n o p q r s t u v w x y z) do if "%1"=="%%a" goto error1
  98. for %%a in (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) do if "%1"=="%%a" goto error1
  99. for %%a in (a b c d e f g h i j k l m n o p q r s t u v w x y z) do if "%1"=="%%a:" goto error1
  100. for %%a in (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) do if "%1"=="%%a:" goto error1
  101. if "%1"=="z:\" goto error1
  102. if "%1"=="Z:\" goto error1
  103.  
  104. for %%a in (a b c d e f g h i j k l m n o p q r s t u v w x y) do if "%1"=="%%a:\" goto begin
  105. for %%a in (A B C D E F G H I J K L M N O P Q R S T U V W X Y) do if "%1"=="%%a:\" goto begin
  106. if exist %1 goto is_file
  107. if exist %1\*.* goto begin
  108.   ctty nul
  109.   rem>%1\$chkpath.nul
  110.   ctty con
  111.   if not exist %1\$chkpath.nul goto not_existing
  112.   del %1\$chkpath.nul
  113. :begin
  114. if exist Z:\*.* goto z_exists
  115.   ctty nul
  116.   rem>Z:\$chkpath.nul
  117.   ctty con
  118.   if not exist Z:\$chkpath.nul goto nosubstz
  119.     del Z:\$chkpath.nul
  120.  
  121. :z_exists
  122. echo --- Existing substitution or network assignment of drive Z: will be lost;
  123. echo     drive Z will be temporarily substituted as %1
  124. echo     Restore original substitution after termination of this program:
  125. subst|find "Z:"
  126. net use|find "Z:"
  127. echo (Ignore eventual "Bad command or file name" above...........)
  128.  
  129. :nosubstz
  130. rem If Z: is write protected its existence can not be checked. So to be
  131. rem sure Z: is being freed below from substitution or network assignment.
  132. subst z: /d >nul
  133. rem disconnect drive Z: from network, ignore eventual error message..........
  134. ctty nul
  135. net use z: /d >nul
  136. ctty con
  137.  
  138. rem check whether Z: now indeed does not exist
  139. if not exist Z:\*.* goto mount
  140.   ctty nul
  141.   rem>Z:\$chkpath.nul
  142.   ctty con
  143.   if not exist Z:\$chkpath.nul goto mount
  144.     del Z:\$chkpath.nul
  145.     echo *** Existing drive Z:\ could not be disconnected successfully.
  146.     echo     It still may be ASSIGNed or otherwise existing. Program abort!
  147.     goto beep
  148.  
  149. :mount
  150. rem substitute Z: to specified drive:\path to transfer
  151. subst z: %1 >nul
  152. rem and check whether substitution succeeded
  153. if exist Z:\*.* goto zz_exists
  154.   ctty nul
  155.   rem>Z:\$chkpath.nul
  156.   ctty con
  157.   if not exist Z:\$chkpath.nul goto no_z_nul
  158.     del Z:\$chkpath.nul
  159.  
  160. :zz_exists
  161. echo --- Cloning branch: %1, file specification: %2
  162. if not "%3"=="" echo     Additional option(s): %3 %4 %5 %6 %7 %8 %9
  163. rem Create beginning of subdirectory listing:
  164. echo echo off>$dirlist.bat
  165. if not exist $dirlist.bat goto nodirlist
  166. echo --- Create subdirectory listing (root not included), wait.....................
  167. ctty nul
  168. disk /d /b z:>>$dirlist.bat
  169. ctty con
  170. $dirlist echo
  171. rem Process $DIRLIST.BAT with "%1 d:\path %2" lines into $FILLIST.BAT with
  172. rem "%2 %3 %4 %5 d:\path\%1 %6 %7 %8 %9" lines
  173. echo echo off>$fillist.bat
  174. if not exist $fillist.bat goto nofillist
  175. echo %%2 %%3 %%4 %%5 Z:\%%1 %%6 %%7 %%8 %%9>>$fillist.bat
  176. ctty nul
  177. $dirlist %0 .sub5
  178. ctty con
  179.  
  180. rem Create $FILSPEC.BAT containing "shift║%0 %1 filespec %2 %3 %4 %5 %6 %7 %8 %9"
  181. rem ('shift' in order not to output $FILSPEC as %0 when used later from REPLICA,
  182. rem  but REPLICA, to insert FILESPEC as %2 and to keep all other 7 parameters.)
  183. echo echo off>$filspec.bat
  184. if not exist $filspec.bat goto nofilspec
  185. echo shift>>$filspec.bat
  186. echo %%0 .filspec %%0 %%1 %2 %%2 %%3 %%4 %%5 %%6 %%7 %%8 %%9>>$filspec.bat
  187. echo --- transfer subdirectory structure $DIRLIST.BAT, filelist $FILLIST.BAT
  188. echo     and filespec $FILSPEC.BAT
  189. rem with only optional COM port and/or baudrate parameter
  190. %0 .sub2 %0 %3 %4 %5 %6 %7 %8 %9
  191.  
  192. rem Process $DIRLIST.BAT with "%1 d:\path %2" lines into $ZIPLIST.BAT with
  193. rem "zip d:\path\%1 /[d:\path] %2 %3 %4 %5 %6 %7 %8" lines
  194. echo echo off>$ziplist.bat
  195. if not exist $ziplist.bat goto noziplist
  196. echo zip Z:\%%1 /[Z:\] %%2 %%3 %%4 %%5 %%6 %%7 %%8>>$ziplist.bat
  197. ctty nul
  198. $dirlist %0 .sub4
  199. ctty con
  200. echo --- transfer all files, wait for receiver creating subdir structure
  201. %0 .sub6 %0 $ziplist %2 %3 %4 %5 %6 %7 %8 %9
  202. echo --- Unlink server
  203. rem include all ZIP options
  204. %0 .sub6 %0 zip /u %3 %4 %5 %6 %7 %8 %9
  205.  
  206. :finish
  207. REM The two 'FOR' lines below activate a bug in the BATch compiler if wildcards
  208. REM are specified. Their function has been reprogrammed differently.
  209. REM Compiler: BAT2EXEC 1.5 (c) 1990, 1991 Ziff Communications Co.
  210. REM           PC Magazine ■ Douglas Boling.
  211. REM for %%a in (%3 %4 %5 %6 %7 %8 %9) do if "%%a"==".d" goto delete
  212. REM for %%a in (%3 %4 %5 %6 %7 %8 %9) do if "%%a"==".D" goto delete
  213. for %%a in (d D) do if "%3"==".%%a" goto delete
  214. for %%a in (d D) do if "%4"==".%%a" goto delete
  215. for %%a in (d D) do if "%5"==".%%a" goto delete
  216. for %%a in (d D) do if "%6"==".%%a" goto delete
  217. for %%a in (d D) do if "%7"==".%%a" goto delete
  218. for %%a in (d D) do if "%8"==".%%a" goto delete
  219. for %%a in (d D) do if "%9"==".%%a" goto delete
  220. goto unmount
  221.  
  222. :delete
  223. rem check whether to delete all successfully transferred files
  224. if not exist $filspec.bat goto unmount
  225.   echo --- Deleting file specification %2 within branch %1
  226.   $fillist %2 %0 .sub7
  227.   rem () can not remove the directory list from $DIRLIST.BAT:
  228.   rem 1. the directories should be processed in the reverse order, not possible;
  229.   rem 2. there may still be files in them if not the default of *.* was given;
  230.   rem 3. directories may be substituted or protected, not possible to remove.
  231.  
  232. :unmount
  233. subst z: /d >nul
  234. if exist $dirlist.bat del $dirlist.bat
  235. if exist $dirlist.bat echo delete $DIRLIST.BAT yourself.
  236. if exist $ziplist.bat del $ziplist.bat
  237. if exist $ziplist.bat echo delete $ZIPLIST.BAT yourself.
  238. if exist $fillist.bat del $fillist.bat
  239. if exist $fillist.bat echo delete $FILLIST.BAT yourself.
  240. if exist $filspec.bat del $filspec.bat
  241. if exist $filspec.bat echo delete $FILSPEC.BAT yourself.
  242. echo === Termination of CLONE ===
  243. goto end
  244.  
  245. :nodirlist
  246. echo *** Unable to create $DIRLIST.BAT.
  247. goto explain
  248. :nofillist
  249. echo *** Unable to create $FILLIST.BAT.
  250. goto explain
  251. :nofilspec
  252. echo *** Unable to create $FILSPEC.BAT.
  253. goto explain
  254. :noziplist
  255. echo *** Unable to create $ZIPLIST.BAT.
  256. :explain
  257. echo     Current default drive:directory may be full or the directory entry
  258. echo     table is full or the disk is write protected or it is an existing
  259. echo     subdirectory name. Take whatever precautions are necessary to solve
  260. echo     this (enable write, delete some redundant file(s)).
  261. goto unmount
  262.  
  263. :$dirlist
  264. echo *** Unable to delete (or overwrite later) $DIRLIST.BAT
  265. goto $explain
  266. :$ziplist
  267. echo *** Unable to delete (or overwrite later) $ZIPLIST.BAT
  268. goto $explain
  269. :$fillist
  270. echo *** Unable to delete (or overwrite later) $FILLIST.BAT
  271. goto $explain
  272. :$filspec
  273. echo *** Unable to delete (or overwrite later) $FILSPEC.BAT
  274. :$explain
  275. echo     File and/or disk may be write protected, unprotect it/them.
  276. goto end
  277.  
  278. :error1
  279. echo *** Illegal source path specification %1 ***
  280. goto beep
  281.  
  282. :no_z_nul
  283. echo *** Impossible to install auxiliary substituted drive Z:.
  284. echo     - Maybe the external DOS SUBST command is not available.
  285. echo     - Maybe the necessary line "LASTDRIVE=Z" lacks in CONFIG.SYS.
  286. echo     - Maybe an already substituted or network drive has been specified;
  287. echo       only logical drives may be specified.
  288. echo     - Maybe an original drive Z: is write protected.
  289. echo     - Maybe the disk with %1 is write protected.
  290. echo     - Or maybe a wrong syntax has been applied (see below).
  291. echo     Correct and try again.
  292. goto beep
  293.  
  294. :not_existing
  295. echo *** Specified «drive»«path» %1 does not exist or is write protected.
  296. echo     Remove eventual protection (for check). Program abort!
  297. goto beep
  298. :is_file
  299. echo *** Specified «drive»«path» %1 is a file, not a subdirectory.
  300. echo     Program abort!
  301. goto beep
  302. :beep
  303. echo  
  304. pause
  305.  
  306. :help
  307. echo Usage: "CLONE «drive»«path» [«filespec»] [options]" of subdirectory to
  308. echo               transfer, including all subdirectories below (branches),
  309. echo with   «drive»  = logical (not substituted) drive A..Y (not Z:),
  310. echo and    «path»   = complete pathname, without trailing \, unless root,
  311. echo and [«filespec»]= optional file specification, wildcard (default *.*),
  312. echo and   [options] = one or more of optional parameters below:
  313. echo              .s : skip initial test for temporary scratch files
  314. echo              .d : delete specified files after successful transfer
  315. echo            ( /1│/2│/3│/4 : COM port number
  316. echo            ( /P : prompt for each file
  317. echo   see also ( /N : no overwrite (default overwrite)
  318. echo   ZIP.DOC  ( /E : send only already existing files (useless in this case)
  319. echo            ( /T : overwrite only older files, not newer ones
  320. echo            ( /Bbaudrate : sets baudrate
  321. echo Example: "CLONE C:\" or "CLONE D:\WORK\TEXTS *.TXT /2 .S /t .d".
  322. echo.
  323. echo On the receiving end the following has to be entered:
  324. echo "REPLICA «drive»«path» [options]" of receiving subdirectory.
  325. goto end
  326.  
  327. :sub1
  328. shift
  329. shift
  330. rem Remove .s .S from parameters and restart batch file................
  331. for %%a in (s S) do if "%1"==".%%a" goto s1
  332. for %%a in (s S) do if "%2"==".%%a" goto s2
  333. for %%a in (s S) do if "%3"==".%%a" goto s3
  334. for %%a in (s S) do if "%4"==".%%a" goto s4
  335. for %%a in (s S) do if "%5"==".%%a" goto s5
  336. for %%a in (s S) do if "%6"==".%%a" goto s6
  337. for %%a in (s S) do if "%7"==".%%a" goto s7
  338. for %%a in (s S) do if "%8"==".%%a" goto s8
  339. for %%a in (s S) do if "%9"==".%%a" goto s9
  340. %0 .entry2 %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
  341. goto exit
  342.  
  343. :s1
  344. %0 .sub1 %0 %2 %3 %4 %5 %6 %7 %8 %9
  345. goto exit
  346. :s2
  347. %0 .sub1 %0 %1 %3 %4 %5 %6 %7 %8 %9
  348. goto exit
  349. :s3
  350. %0 .sub1 %0 %1 %2 %4 %5 %6 %7 %8 %9
  351. goto exit
  352. :s4
  353. %0 .sub1 %0 %1 %2 %3 %5 %6 %7 %8 %9
  354. goto exit
  355. :s5
  356. %0 .sub1 %0 %1 %2 %3 %4 %6 %7 %8 %9
  357. goto exit
  358. :s6
  359. %0 .sub1 %0 %1 %2 %3 %4 %5 %7 %8 %9
  360. goto exit
  361. :s7
  362. %0 .sub1 %0 %1 %2 %3 %4 %5 %6 %8 %9
  363. goto exit
  364. :s8
  365. %0 .sub1 %0 %1 %2 %3 %4 %5 %6 %7 %9
  366. goto exit
  367. :s9
  368. %0 .sub1 %0 %1 %2 %3 %4 %5 %6 %7 %8
  369. goto exit
  370.  
  371. :sub2
  372. shift
  373. shift
  374. rem Remove /p /n /e /t /P /N /E /T .d .D temporarily from parameters and execute
  375. rem 'ZIP $DIRLIST.BAT,$FILLIST.BAT,$FILSPEC.BAT ...'
  376. rem only with Com port and Baudrate parameters
  377. for %%a in (p n e t P N E T) do if "%1"=="/%%a" goto p1
  378. for %%a in (p n e t P N E T) do if "%2"=="/%%a" goto p2
  379. for %%a in (p n e t P N E T) do if "%3"=="/%%a" goto p3
  380. for %%a in (p n e t P N E T) do if "%4"=="/%%a" goto p4
  381. for %%a in (p n e t P N E T) do if "%5"=="/%%a" goto p5
  382. for %%a in (p n e t P N E T) do if "%6"=="/%%a" goto p6
  383. for %%a in (p n e t P N E T) do if "%7"=="/%%a" goto p7
  384. for %%a in (d D) do if "%1"==".%%a" goto p1
  385. for %%a in (d D) do if "%2"==".%%a" goto p2
  386. for %%a in (d D) do if "%3"==".%%a" goto p3
  387. for %%a in (d D) do if "%4"==".%%a" goto p4
  388. for %%a in (d D) do if "%5"==".%%a" goto p5
  389. for %%a in (d D) do if "%6"==".%%a" goto p6
  390. for %%a in (d D) do if "%7"==".%%a" goto p7
  391. zip $dirlist.bat,$fillist.bat,$filspec.bat /[] %1 %2 %3 %4 %5 %6 %7
  392. if errorlevel 1 goto error2
  393.   echo === subdirectory structure $DIRLIST.BAT, filelist $FILLIST.BAT
  394.   echo     and filespec $FILSPEC.BAT successfully transferred
  395.   :recover1
  396.   rem      and return to calling point
  397.   goto exit
  398.  
  399. :error2
  400. echo *** An error occurred while sending $DIRLIST.BAT, $FILLIST.BAT and $FILSPEC.BAT
  401. echo     (see above)
  402. goto recover1
  403.  
  404. :p1
  405. %0 .sub2 %0 %2 %3 %4 %5 %6 %7
  406. goto exit
  407. :p2
  408. %0 .sub2 %0 %1 %3 %4 %5 %6 %7
  409. goto exit
  410. :p3
  411. %0 .sub2 %0 %1 %2 %4 %5 %6 %7
  412. goto exit
  413. :p4
  414. %0 .sub2 %0 %1 %2 %3 %5 %6 %7
  415. goto exit
  416. :p5
  417. %0 .sub2 %0 %1 %2 %3 %4 %6 %7
  418. goto exit
  419. :p6
  420. %0 .sub2 %0 %1 %2 %3 %4 %5 %7
  421. goto exit
  422. :p7
  423. %0 .sub2 %0 %1 %2 %3 %4 %5 %6
  424. goto exit
  425.  
  426. :nofilespec
  427. rem %2 is empty or one of the parameters beginning with a '/' or /./
  428. rem Restart %0 with *.* as second parameter and continue from :file_spec
  429. echo --- Default file specification *.* assumed.
  430. %0 .sub3 %0 %1 *.* %2 %3 %4 %5 %6 %7 %8 %9
  431. goto exit
  432.  
  433. :sub3
  434. shift
  435. shift
  436. goto file_spec
  437.  
  438. :sub4
  439. echo zip %1\%%1 /[%1] %%2 %%3 %%4 %%5 %%6 %%7 %%8>>$ziplist.bat
  440. goto exit
  441.  
  442. :sub5
  443. echo %%2 %%3 %%4 %%5 %1\%%1 %%6 %%7 %%8 %%9>>$fillist.bat
  444. goto exit
  445.  
  446. :sub6
  447. shift
  448. shift
  449. rem Remove .d .D temporary from parameters and execute ZIP................
  450. for %%a in (d D) do if "%3"==".%%a" goto d3
  451. for %%a in (d D) do if "%4"==".%%a" goto d4
  452. for %%a in (d D) do if "%5"==".%%a" goto d5
  453. for %%a in (d D) do if "%6"==".%%a" goto d6
  454. for %%a in (d D) do if "%7"==".%%a" goto d7
  455. for %%a in (d D) do if "%8"==".%%a" goto d8
  456. for %%a in (d D) do if "%9"==".%%a" goto d9
  457. %1 %2 %3 %4 %5 %6 %7 %8 %9
  458. if errorlevel 1 goto error3
  459.   if not "%2"=="/u" echo === all files successfully transferred
  460.   if "%2"=="/u" echo === server unlinked successfully
  461.   :recover3
  462.   goto exit
  463.  
  464. :error3
  465. if not "%2"=="/u" echo *** An error occurred while sending files (see above)
  466. rem indicate failure to transfer files by removing $FILSPEC.BAT prematurely
  467. rem (errorlevel cannot be passed down to previous command level)
  468. if not "%2"=="/u" if exist $filspec.bat del $filspec.bat
  469. if "%2"=="/u" echo *** An error occurred while unlinking server (receiving end) (see above)
  470. if "%2"=="/u" echo     You may have to press ESC on the receiving end to finish !!!!!!!!!!!
  471. goto recover3
  472.  
  473. :d3
  474. %0 .sub6 %0 %1 %2 %4 %5 %6 %7 %8 %9
  475. goto exit
  476. :d4
  477. %0 .sub6 %0 %1 %2 %3 %5 %6 %7 %8 %9
  478. goto exit
  479. :d5
  480. %0 .sub6 %0 %1 %2 %3 %4 %6 %7 %8 %9
  481. goto exit
  482. :d6
  483. %0 .sub6 %0 %1 %2 %3 %4 %5 %7 %8 %9
  484. goto exit
  485. :d7
  486. %0 .sub6 %0 %1 %2 %3 %4 %5 %6 %8 %9
  487. goto exit
  488. :d8
  489. %0 .sub6 %0 %1 %2 %3 %4 %5 %6 %7 %9
  490. goto exit
  491. :d9
  492. %0 .sub6 %0 %1 %2 %3 %4 %5 %6 %7 %8
  493. goto exit
  494.  
  495. :sub7
  496. rem Original file specification does not need to be present in every branch:
  497. if not exist %2 goto end
  498. rem To automatically answer Y to eventual "Are you sure (Y/N)?" if original
  499. rem (default) file specification is *.* (here it is preceeded by the path):
  500. echo y|del %2>nul
  501. if not exist %2 goto end
  502. rem Check for successful deletion of %2 below branch %1
  503. echo.
  504. echo ***************************************************************************
  505. echo !!! Warning: target file specification %2 still exists!
  506. dir %2 /w /p
  507. echo     You may have to delete %2 yourself.
  508. pause
  509. goto end
  510.  
  511. :end
  512. :exit
  513.