' This program uses the shell command extensively in order to get around ' the 8.3 filename character limitations in DOS. CLS PRINT " HTMLR Index Page Generator" PRINT " TawbaWare software, August 1998" PRINT : PRINT : PRINT ON ERROR GOTO trap startdir$ = COMMAND$ if instr(startdir$,"/?")>0 then print "HTMLR creates a web page with hyperlinks to all the subdirectories contained " print "underneath a specified directory. The web page created by HTMLR lists the " print "size of each subdirectory as well as the number of files (of any or all " print "types) in each subdirectory.":print print "HTMLR stores the resulting web page in the same directory that the user print "specifies. HTMLR accepts directory names on the command line.":print:print startdir$="" end if IF startdir$ = "" THEN PRINT "Input directory to process (Enter = " + curdir$ + ")-->"; INPUT ,startdir$ END IF IF startdir$ = "" THEN startdir$ = curdir$ if right$(startdir$,1)<>"\" then startdir$=startdir$+"\" if command$ = "" then INPUT "Sort by (n)ame or (d)ate-->", sortord$ IF sortord$ <> "n" AND sortord$ <> "-n" AND sortord$ <> "d" AND sortord$ <> "-d" THEN sortord$ = "n" getlink: if command$ = "" then Print "Link to file within subdirectory (Enter = None, " + chr$(34) + "?" + chr$(34) + " for help)-->"; input ,pagelink$ if pagelink$="?" then pagelink$="" print:print print "If you specify a filename here, for example " + chr$(34) + "linkpage.htm" + chr$(34) + ", then the " print "web page created by HTMLR will include links to that file in each " print "subdirectory that it processes. If you don't specify a filename, " print "then HTMLR will create a link to each subdirectory that it processes, " print "but not to any a particular file within that directory.":print:print goto getlink: end if end if if pagelink$<>"" then pagelink$="/" + pagelink$ if command$ = "" then print "Select filetypes, e.g. " + chr$(34) + "*.jpg"; print chr$(34) + " or " + chr$(34) + "*.txt" + chr$(34) + ". (Enter=" + chr$(34) + "*.*" + chr$(34) + ")-->"; input ,fileext$ print if command$ = "" then input "Body background color (Enter=FFFFFF)-->", bgcolor$ if bgcolor$="" then bgcolor$="FFFFFF" if command$ = "" then Print "Web page title (Enter = " + chr$(34) + "Index Page" + chr$(34) + ")-->"; input , pagetit$ end if if pagetit$="" then pagetit$="Index Page" shell left$(startdir$,2) ' change drive? SHELL "cd " + CHR$(34) + startdir$ + CHR$(34) PRINT : PRINT : PRINT "Processing...": PRINT : PRINT ' create a list of all sub-directories in the specified directory SHELL "dir /a:d /o:" + sortord$ + " /b > temp.tmp" 'start the webpage OPEN "htmlr.htm" FOR OUTPUT AS #2 PRINT #2, ""+pagetit$+"" PRINT #2, "