Jump to content

VOL and | pipe problem


Recommended Posts

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 here

rem 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 instCRT

This 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


you would probably have been better using

if not errorlevel 1 goto instLCD

however you could try this

vol c:|find "BALCD">NUL 2>&1 &&goto instLCD
vol c:|find "BACRT">NUL 2>&1 &&goto instCRT

If 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 by Yzöwl
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...