I am trying to write a batch script to detect a USB drive and, if it is plugged in,
for example copy c:\\test\\big.txt to the USB drive, and looping to detect anoth
@echo off
for /F "usebackq tokens=1,2,3,4 " %%i in (`wmic logicaldisk get caption^,description^,drivetype 2^>NUL`) do (
if %%l equ 2 (
copy c:\test\big.txt %%i
)
)
This is assuming of course both drives are inserted.