; Subst ; ----- ; A GUI frontend for the command line SUBST command. ; Note use of Script start command to access the ; command line SUBST. Also wait and while commands ; to detect startup and completion of SUBST. ; ;report on :enter delfile \tmp3.tmp start cmd.exe /c subst > \tmp1.tmp,,X|X,,SUBST wait SUBST,7 iferror prob while SUBST setvar C, readline \tmp1.tmp,C iferror getdrv getscrnx A divvar A,4 decvar A,50 setvar A,100 console Virtual Drives,The following virtual drives are mapped||,C,%A|C, :loop2 iferror getdrv substr %C,1,1,A substr %C,9,50,B console Virtual Drives,%A: => %B|,,, nextline \tmp1.tmp,C goto loop2 :getdrv step off chrbox Virtual Drive,Enter the virtual drive letter:,A,%A,,10|D ifmsg cancel,end upvar A delfile \tmp1.tmp start cmd.exe /c subst > \tmp2.tmp,,X|X,,SUBST wait SUBST,7 iferror prob while SUBST setvar C, readline \tmp2.tmp,C :loop1 iferror nodr srchstr %C,%A:,B ifnerror cont0 nextline \tmp2.tmp,C goto loop1 :nodr disktype %A,D ifvar D,,cont1 msgbox Problem,%A: is a real drive and cannot be used|Please select another drive letter,0 goto enter :cont0 srchstr %C,=,B incvar B,3 substr %C,%B,50,D msgbox Problem,Drive %A is already mapped to %D|Do you want to delete drive %A?,4 ifnmsg 6,enter setvar B,/D goto cont2 :cont1 dirbox Select the path:,B,drives ifmsg cancel,end setvar B,"%B" :cont2 delfile \tmp2.tmp start cmd.exe /c subst %A: %B > \tmp3.tmp,,X|X,,SUBST wait SUBST,7 iferror prob while SUBST setvar C, readline \tmp3.tmp,C ifnvar C,,exit ifvar B,/D,cont3 setvar C,Created new virtual drive %A mapped to %B goto exit :cont3 setvar C,Virtual drive %A deleted goto exit :prob setvar C,Unable to map virtual drive (no SUBST command) :exit conoff msgbox Virtual Drive %A,%C|Do you wish to exit,4 ifmsg 7,enter :end conoff delfile \tmp1.tmp delfile \tmp2.tmp delfile \tmp3.tmp