发现优盘的盘符 [英] Find USB Drive letter

查看:102
本文介绍了发现优盘的盘符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要获得USB笔drive.the命令CHDIR的驱动器号> drive.txt给我的驱动器字母L:做。怎么我读/得到这个信息L:不带引号成一个变量我批处理文件


解决方案

 为%%一中(defghijklmnopqrstuvwx YZ)做第%%一个:2  - ; NUL |的找到NAME USB> NUL&放大器;&安培;
集DRV = %%一个:
%DRV%

这我什么,我用它来找到我的USB信


  • 只要改变THE USB名到USB的名称

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 variable in my batch file

解决方案

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

这篇关于发现优盘的盘符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆