Find Volume number in bat file

February 6, 2009 at 10:26:09
Specs: Windows XP
Im looking for a way to programatically detect the volume NUMBER as shown in
list volume
at a windows command prompt. I need to write a bat file to detect that based on volume LABEL to trick an old software installer that has the A:\ path hardcoded into running from a flash drive... it works when I change the drive letter manually, but I want it to be more elgant.

So far I have the following:

@echo off

[here's the part where volume number is found for the drive with the label 'LS']

select volume [volume number detected before]

remove letter=[old letter, set in variable for later]

assign letter=A

[run install.exe]

select volume [volume number detected before]
assign letter=[previous letter set in variable earlier]

See More: Find Volume number in bat file

Report •

February 7, 2009 at 11:13:42
Extracting the disk number from Diskpart List Volume is relatively simple, as for the rest - please post your code.

Report •
Related Solutions

Ask Question