Find USB Drive letter

前端 未结 5 449
星月不相逢
星月不相逢 2020-12-18 16:57

I need to get the drive letter of the usb pen drive.the command CHDIR >drive.txt gives me the drive letter L:.How do I read/get this info \"L:\" without quotes into a variab

5条回答
  •  借酒劲吻你
    2020-12-18 17:30

    for %%a in (d e f g h i j k l m n o p q r s t u v w x y z) do vol %%a: 2>nul |find "NAME OF THE USB" >nul && 
    set drv=%%a:
    %drv%
    

    This i what i use to find the letter on my USB

    • Just change the "NAME OF THE USB" to the name of the USB

提交回复
热议问题