How to list your disk drives in DOS

willias rowild -  
brucine Posted messages 24370 Registration date   Status Membre Last intervention   -
Hello,

how to display the list of all drives present on my PC via MS DOS?

4 réponses

KarCAroum Posted messages 298 Status Membre 91
 
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
0
KarCAroum Posted messages 298 Status Membre 91
 
or
fsutil fsinfo drives
1
Tino
 

There are indeed many old computers with MS-DOS, just answer the question sometimes!

0
steph810 Posted messages 1849 Registration date   Status Membre Last intervention   154 > Tino
 

You can try fdisk

!!! Be careful not to format everything

What are you running, Win 95-98???

0
brucine Posted messages 24370 Registration date   Status Membre Last intervention   4 094 > steph810 Posted messages 1849 Registration date   Status Membre Last intervention  
 

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
0