Avatar of Julian Parker
Julian Parker
Flag for United Kingdom of Great Britain and Northern Ireland

asked on 

Find drive letter of a named drive

Hi,

I want to write a simple backup batch file to backup to a USB drive amongst other things.

I can list the volume using diskpart /s diskscript.txt where diskscript.txt has "list volume" in it and then search for the diskname;
eg/
   diskpart /s diskscript.txt | find "BACKUP"

I now need to extract the disk volume from the string and assign it to a variable.
  Volume 4     F   BACKUP    FAT32  Removeable  1934 MB

I don't want to hard code the drive letter in the script as it may change. If awk was available as standard I'd be ok :-).

Is there a MSDOS alternative?

O/S is Windows XP Home/Professional.

I will up the points for a quick response... hell I may even do it anyway! :-)


Microsoft DOSWindows XP

Avatar of undefined
Last Comment
Julian Parker

8/22/2022 - Mon