andymitchell Posted February 10, 2006 Share Posted February 10, 2006 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? Link to comment Share on other sites More sharing options...
IcemanND Posted February 11, 2006 Share Posted February 11, 2006 How about this.@for /f "tokens=6" %%A in ('vol') do @if "%%A"="BALCD" goto instLCD Link to comment Share on other sites More sharing options...
Yzöwl Posted February 11, 2006 Share Posted February 11, 2006 (edited) 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, 2006 by Yzöwl Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now