- :SetOSvar
- @echo off
- IF NOT DEFINED usbdrv (
- ECHO locating OS drive
- FOR %%b IN ( C D E F G H I J K L M N O ) DO (
- IF EXIST %%b:\<specialfilename1> IF EXIST %%b:\ <specialfilename2> (
- SET usbdrv=%%b^:
- for /f %%A in ('mountvol %%b:\ /L') do set id=%%A
- )
- )
- )
- echo id=%id%
复制代码
|