View Single Post
  #17  
Old September 6th 20, 09:34 AM posted to alt.comp.os.windows-10
R.Wieser
external usenet poster
 
Posts: 1,302
Default What solution do you use to figure out what USB drive letter in a Windows scripted command?

Arlen,

For finding the serial number, Poutnik proposed a Nirsoft utility


You have crossposted into a few newsgroups, implicitily telling us you want
to have the solution also work there. I don't think there are many
programs that will work as well under MSDOS as well as the full range of
Windows versions (in both 32 as well as 64 bit variants) (and I will not
even consider Win 3.x there :-) )

The loop and check for a certain file/folder should work on any of them
(which is why I suggested the latter).

And by the way: You can ofcourse create a file/folder with a name taken from
the data that that Nirsoft utility returns or which you can find yourself
using standard commands/utilities provided with the OS. That gives you the
best of both worlds : A (supposedly!) unique ID taken from the stick itself,
while still being able to use the stick in any of the implied OSes.

Or you can just run a GUID generator and use that as the file/folder name
....

In summary, we have to key off of "something" to identify the drive:
a. The serial number of the USB device
b. The volume name of the USB device
c. The label of the USB device
d. The mount point (aka Drive Letter) of the USB device


Neither a, b or c are considered to be unique. At least b and c can be
altered by the (non-admin) user himself.

As for d ? You're pulling our leg, right ? The very problem you started
with is that that one is not even constant. If it where this whole thread
would not have existed in the first place :-)

Regards,
Rudy Wieser



Ads