February 10, 200620 yr I have an unattended install that starts from DOS and displays a message, partitions and formats the HD then reboots and starts the install. There is a line in my batch that looks at the volume name to deceide if its done the partition and format already. The line uses 'vol' and pipes the output into the 'find' command and sets the error level if it finds a match. The lines are :rem check for volume labels hererem jump next section if match is found@vol c: | find "BALCD" /c > NUL@if NOT errorlevel==1 goto instLCD@vol c: | find "BACRT" /c > NUL@if NOT errorlevel==1 goto instCRTThis all works fine when testing with my floppy drive. I have now burnt a CD containing the files from the FD as my install must only be a single cd. The problem is that the pipe | command pipes the information via a temp file and not in RAM. So it works fine when useing a FD but i get a write error when usgin the CD. Does anyone know a way around this, or maybe have an alternate 'vol' command?
February 11, 200620 yr How about this.@for /f "tokens=6" %%A in ('vol') do @if "%%A"="BALCD" goto instLCD
February 11, 200620 yr you would probably have been better usingif not errorlevel 1 goto instLCDhowever you could try thisvol c:|find "BALCD">NUL 2>&1 &&goto instLCDvol c:|find "BACRT">NUL 2>&1 &&goto instCRTIf you are having the problems as you say with the pipe from a cd-rom then@for /f "tokens=6" %%? in ('vol c:') do ( @if "%%?" equ "BALCD" goto instLCD @if "%%?" equ "BACRT" goto instCRT) Edited February 11, 200620 yr by Yzöwl
Create an account or sign in to comment