Code: Select all
you have 4 Hard drives:
c:\ , d:\ , e:\ , f:\
and 2 cd/dvd drives:
g:\ , h:\
and 1 floppy drive:
a:\
sorry for my english
Moderator: DosItHelp
Code: Select all
you have 4 Hard drives:
c:\ , d:\ , e:\ , f:\
and 2 cd/dvd drives:
g:\ , h:\
and 1 floppy drive:
a:\
Code: Select all
@echo off
wmic logicaldisk get caption,drivetype > C:\drive.txt
Code: Select all
@echo off &setlocal
for /f "tokens=1*" %%a in ('fsutil fsinfo drives') do (
for %%c in (%%b) do (
fsutil fsinfo drivetype %%c
)
)
pause
rfpd wrote:Try this code:Code: Select all
@echo off
wmic logicaldisk get caption,drivetype > C:\drive.txt
Output:
Caption DriveType
C: 3
D: 3
E: 3
F: 5
H: 5
3 means hard drive
5 meand cd/drive drive
I hope i helped.
Regards, rfpd.
aGerman wrote:Another possibility:Code: Select all
@echo off &setlocal
for /f "tokens=1*" %%a in ('fsutil fsinfo drives') do (
for %%c in (%%b) do (
fsutil fsinfo drivetype %%c
)
)
pause
Run as administrator on Win7.
Regards
aGerman
aGerman wrote:Well then a simple double click should run the script. Didn't you try it?
Regards
aGerman
Mohammad_Dos wrote:aGerman wrote:Well then a simple double click should run the script. Didn't you try it?
Regards
aGerman
yes, of course
dont work in win xp
Mohammad_Dos wrote:I have a question:
how to replace these words in the c:\Drive.txt ?
Code: Select all
@echo off &setlocal enabledelayedexpansion
set "DriveType_1=Unknown"
set "DriveType_2=Removeable Drive"
set "DriveType_3=Local Hard Disk"
set "DriveType_4=Network Hard Disk"
set "DriveType_5=Compact Disc"
set "DriveType_6=RAM Disk"
(
for /f "tokens=1,2" %%a in ('wmic logicaldisk get caption^,drivetype') do (
set "Drive=%%a "
set "TypeName="
set "TypeName=!DriveType_%%b!"
if not defined TypeName set "TypeName=%%b"
echo(!Drive:~0,8!!TypeName!
)
)>C:\Drive.txt
aGerman wrote:Another possibility:Code: Select all
@echo off &setlocal
for /f "tokens=1*" %%a in ('fsutil fsinfo drives') do (
for %%c in (%%b) do (
fsutil fsinfo drivetype %%c
)
)
pause
Run as administrator on Win7.
Regards
aGerman
Code: Select all
A:\ - Removable Drive
aGerman wrote:Code: Select all
@echo off &setlocal enabledelayedexpansion
set "DriveType_1=Unknown"
set "DriveType_2=Removeable Drive"
set "DriveType_3=Local Hard Disk"
set "DriveType_4=Network Hard Disk"
set "DriveType_5=Compact Disc"
set "DriveType_6=RAM Disk"
(
for /f "tokens=1,2" %%a in ('wmic logicaldisk get caption^,drivetype') do (
set "Drive=%%a "
set "TypeName="
set "TypeName=!DriveType_%%b!"
if not defined TypeName set "TypeName=%%b"
echo(!Drive:~0,8!!TypeName!
)
)>C:\Drive.txt
Regards
aGerman
Code: Select all
Please wait
A: Removeable Drive
C: Local Hard Disk
D: Local Hard Disk
E: Local Hard Disk
F: Local Hard Disk
G: Compact Disc
H: Local Hard Disk
I: Compact Disc
K: Removeable Drive
Caption DriveType
Code: Select all
@echo off &setlocal enabledelayedexpansion
set "DriveType_1=Unknown"
set "DriveType_2=Removeable Drive"
set "DriveType_3=Local Hard Disk"
set "DriveType_4=Network Hard Disk"
set "DriveType_5=Compact Disc"
set "DriveType_6=RAM Disk"
(
for /f "skip=1 tokens=1,2" %%a in ('wmic logicaldisk get caption^,drivetype') do (
set "Drive=%%a "
set "TypeName="
set "TypeName=!DriveType_%%b!"
if not defined TypeName set "TypeName=%%b"
echo(!Drive:~0,8!!TypeName!
)
)>C:\Drive.txt
Code: Select all
A: Removeable Drive
C: Local Hard Disk
D: Local Hard Disk
E: Local Hard Disk
F: Local Hard Disk
G: Compact Disc
H: Local Hard Disk
I: Compact Disc