
CODE: [Copy to clipboard]其中截取字符能够在xp下执行,但是在vista和windows7中取到的为空。set insDriverName=""
for /f "skip=1 tokens=*" %%j in ('wmic logicaldisk where "drivetype=5" get DeviceID') do (
set tempName=%%j
set tCDROM=%tempName:~0,2%
echo %tCDROM%
if exist "%tCDROM%\tmuninst.ini" (set insDriverName="%tCDROM%\InstallationFiles"))
echo %insDriverName%
CODE: [Copy to clipboard]for %%a in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do (
if exist %%a:\tmuninst.ini set driver="%%a:\InstallationFiles"
)
echo %driver%
pause
CODE: [Copy to clipboard][ Last edited by newxso on 2009-8-12 at 06:20 ]@echo off
set Driver=
for /f "skip=1" %%a in ('wmic logicaldisk where "drivetype=5" get DeviceID') do (
if exist "%%a\tmuninst.ini" (set "Driver=%%a\InstallationFiles")
)
echo %Driver%
pause
| Quote: | |
|
| Quote: | |
|

| Quote: | |
|
| 欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) | Powered by Discuz! 2.5 |