for /f "skip=1 tokens=1,2" %%i in ('wmic logicaldisk get caption^, drivetype') do (
if [%%j]==[5] set cdletter=%%i
)
echo %cdletter%
pause
if "%cdletter%"=="" (
echo Device driver not found: 'MSCD000'
echo No valid CDROM device drivers selected
) else (
echo MSCDEX Version 2.23
echo Copyright (C) Microsoft Corp. 1986-1993. All rights reserved.
pause
echo "Drive %cdletter% = Driver MSCD000 unit 0"
)
I also ran a another if else like this before it and this one works fine. im not sure why this other one is not working
if "%cdletter%"=="" (
timeout 2 >nul
echo No drives found, aborting installation
) else (
chcp 65001 >nul
wmic cdrom where mediatype!='unknown' get name > discinfo.txt
type discinfo.txt > discinfoutf8.txt
rem F THIS YOU HAVE TO DO THIS BECASUE UTF 16 DOESNT WORK IN A FOR LOOP
goto driveinfoecho
)
this just grabs the cd drive info so i can put it into a variable and use it in an echo command