Note that identifying only and all (Type 2) USB drives is easy, but. O Here's how to get a USB drive letter from any offįor /F "usebackq tokens=1,2,3,4 " %%i in (`wmic logicaldisk get caption^,description^,drivetype To _find_ the drive letter (although these just _list_ them all): Other approaches may be to make use of a customized batch script O How to Change a Drive Letter in Windows O How to assign permanent letters to drives on Windows 10Īnother approach appears to be to change the drive letter on the fly: Searching, one approach appears to be to permanently assign a drive letter: Win+R > %comspec% /k for %i 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 2>nul & set/pz=%i %comspec% /k for %a in (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 %a 2>&1 | find "drive"īut how do you ensure the command always uses the right drive letter? Win+R > %comspec% /k wmic logicaldisk where drivetype=2 get deviceid, volumename, description Win+R > %comspec% /k wmic logicaldisk get caption,providername,drivetype,volumename It's easy to obtain the _list_ of devices with drive letters, e.g., O What trick to you employ to get the USB stick unique drive letter? I have a Run command that accesses a file on a USB stick.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
June 2023
Categories |