7016427 当前离线
列兵
@echo off for /f "skip=1 tokens=1" %%i in ('wmic logicaldisk where "description='可移动磁盘'" get deviceid') do ( set "DriveU=%%i" if /i "%%i"=="" (echo 你没有插入u盘,请插入u盘) else (copy e:\日报.xls/y %DriveU%\ ) ) pause复制代码
评分人数
会飞的蜗牛丶 当前离线
TOP
@echo off for /f "skip=1 tokens=1" %%i in ('wmic logicaldisk where "description='可移动磁盘'" get deviceid^|^|echo 没盘') do ( set "DriveU=%%i" if /i "%%i"=="" (echo 你没有插入u盘,请插入u盘) else (copy e:\日报.xls/y %DriveU%\ ) ) pause复制代码
pcl_test 当前离线
荣誉版主
@echo off ver|find "5.1" >nul&&set "str=可移动磁盘"||set "str=Removable Disk" for /f %%a in ('wmic logicaldisk where description^="%str%" get deviceid 2^>nul^|findstr "[A-Z]:"') do set "u=%%a" if not defined u (echo;你没有插入u盘,请插入u盘) else (copy /y "E:\日报.xls" %u%\) ping -n 2 0 >nul&exit复制代码
CrLf 当前离线
论坛巡查
@echo off for /f "skip=1" %%i in ('wmic logicaldisk where "description='可移动磁盘'" get deviceid') do ( set "DriveU=%%i" copy e:\日报.xls/y %%i\ ) if not defined DriveU echo 你没有插入u盘,请插入u盘 pause复制代码
flyinnet9 当前离线
少尉
@echo off wmic logicaldisk where "description='可移动磁盘'" get deviceid |find "DeviceID" if %errorlevel%==1 echo 你没有插入u盘,请插入u盘&goto :eof for /f "skip=1 tokens=1" %%a in ('wmic logicaldisk where "description='可移动磁盘'" get deviceid') do copy /y e:\日报.xls %%a\复制代码
Linuxer 当前离线
五级士官