How to list your disk drives in DOS
brucine Posted messages 24901 Registration date Status Member Last intervention -
how to display the list of all drives present on my PC via MS DOS?
4 answers
-
it all depends on what you want to do
(Dos no longer exists)
under the command interpreter
diskpart (beware !!! don't mess around)
list volume-
-
Hello,
Since this is about politely responding to off-topic posts, we should first agree on what old computers are.
Real DOS mode is only supported up to Windows 98; after that, we have a 32-bit command interpreter.
Even if the ancient machine runs under MsDos 6.22 without Shell or Windows 3.11 where the FOR command is operational, FSUTIL only works in emulated DOS.
In the first case, we will indeed have issues with network drives unless a letter is assigned to them via SUBST, and they must also be accessible, meaning that specific network drivers need to be added to MsDos, along with USB drives.
Starting from Windows 95, the syntax is universal, as noted on Professor Salmi's Batch site, which struggles to even know XP as early as 2010-2011:
@echo off & setlocal enableextensions enabledelayedexpansion for %%d in (a: b: c: d: e: f: g: h: i: j: k: l: m: n: o: p: q: r: s: t: u: v: w: x: y: z:) do ( dir %%d\ > nul 2>&1 if !errorlevel! EQU 0 echo %%d ) endlocal & goto :EOF
In emulated DOS, I can also get the type, and since it's in English, "No such Root Directory" needs to be replaced with "Ce répertoire racine n'existe pas"
@echo off & setlocal enableextensions (for %%d in (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) do ^ @fsutil fsinfo drivetype %%d:) ^ | find /v "No such Root Directory" endlocal & goto :EOF
-