P
P
Pavel2019-06-11 13:50:14
cmd/bat
Pavel, 2019-06-11 13:50:14

How to find out the drive letter belongs to a local drive / flash drive or something else?

If Not Exist d: goto :t2
dir /b /s d:\*.jpg d:\*.png >>%t%
:t2

I made such a piece of code to collect all the pictures in a log.txt file (this is% t%) . But it is necessary to collect information from all disks,
the problem is that it is necessary to collect data only from local disks, but not from flash drives, cloud disks, especially cd / dvd,
who will advise what?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Ronald McDonald, 2019-06-11
@mrusklon

You won't know for sure.

D
dmfun, 2019-06-11
@dmfun

wmic logicaldisk where drivetype=3 get deviceid Maybe
so, this solution is not complete
drivetype
_________________
Removable Disk (2)
Local Disk (3)
Network Drive (4)
From the opposite. Get only a list of local drives.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question