I want to list all windows partitions and then exclude partition in which window is installed like (C:\ , it can be any letter) here is command to list partitions
for /f "skip=1 delims=" %x in ('wmic logicaldisk get caption') do @echo.%x
output:
D:
E:
C:
M:
X:
Y:
and here is command to find partition in which windows is installed
for /f "tokens=1 delims=\" %i in ('echo %userprofile%') do @echo %i
output:
C:
is there any for loop command to list all partitions excluding windows partition and can output like this
D:
E:
M:
X:
Y:
%SystemRoot%
(or%SystemDrive%
) rather than%UserProfile%
).