home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / b / butl.zip / BATMAKR1.BAS < prev    next >
BASIC Source File  |  1993-03-01  |  1KB  |  36 lines

  1. 100 'BATMAKR1.BAS -- by Paul Somerson 
  2. 110 ' (c) 1987 Ziff Communications Co.
  3. 120 'This creates easy subdirectory switcher files
  4. 130 'Before you use this, get into DOS and type:
  5. 140 '
  6. 150 '    CHKDSK / V | FIND "Dir" > TEMPFILE
  7. 160 '
  8. 170 'For this to work properly, make sure each
  9. 180 '    subdirectory has its own unique name.
  10. 190 'To switch between subdirectories in DOS, type
  11. 200 '    name of the subdirectory WITHOUT the CD\
  12. 210 '    prefix, and WITHOUT the long PATHname
  13. 220 '    that usually precedes it.
  14. 230 'For instance, to switch to \DOS\BIN, just
  15. 240 '    type:  BIN
  16. 250 ON ERROR GOTO 440
  17. 260 '
  18. 270 ' --- read raw file, truncate left end of each line ---
  19. 280 '
  20. 290 OPEN "tempfile" FOR INPUT AS #1
  21. 300 IF EOF(1) THEN 430 ELSE LINE INPUT #1,A$
  22. 310 A$=RIGHT$(A$,LEN(A$)-12):IF A$="\" THEN 300
  23. 320 FOR A=LEN(A$) TO 1 STEP -1
  24. 330 IF MID$(A$,A,1)<>"\" THEN 350
  25. 340 NM$=RIGHT$(A$,LEN(A$)-A)+".BAT":GOTO 390
  26. 350 NEXT
  27. 360 '
  28. 370 ' --- start churning out the batch files ---
  29. 380 '
  30. 390 PRINT "Creating ";NM$;" batch file..."
  31. 400 OPEN NM$ FOR OUTPUT AS #2
  32. 410 PRINT #2,"CD"+A$;:CLOSE #2
  33. 420 GOTO 300
  34. 430 CLOSE:KILL "tempfile.":PRINT:LIST 170-240:END
  35. 440 IF ERR=53 THEN LIST 130-160 ELSE ON ERROR GOTO 0
  36.