[ 本帖最后由 bbsphixy 于 2011-10-29 21:11 编辑 ]作者: yfwang0798 时间: 2011-10-30 09:22
@echo off
if exist a.txt del a.txt /f
if exist b.txt del b.txt /f
REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MediaPlayer\PlayerUpgrade" /v PlayerVersion>a.txt
for /f "skip=3 tokens=3" %%a in (a.txt) do echo %%a>b.txt
for /f "tokens=1 delims=," %%i in (b.txt) do set v=%%i
if %v%==5 (
echo 0
goto end
)
if %v%==6 (echo 0) else echo 1
:end
del a.txt /f
del b.txt /f
pause
[ 本帖最后由 yfwang0798 于 2011-10-30 13:11 编辑 ]作者: freesoft00 时间: 2011-10-30 13:11
不生成临时文件的方法呢作者: 2011eney0828 时间: 2011-10-31 09:16
小弟我搞了好久的結果
@echo off
regedit /e WMPVer.reg HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MediaPlayer\PlayerUpgrade
type WMPVer.reg |findstr /c:"PlayerVersion" >WMP.tmp
for /f "tokens=2 delims== " %%* in (WMP.tmp) do echo %%~* >C:\WMP.txt
for /F "tokens=1-4 delims=," %%* in (C:\WMP.txt) DO (set "WMP=%%~*")
del /f WMP.txt
del /f WMPVer.reg
del /f WMP.tmp
if %WMP% GEQ 7 set OKWMP=1
if %WMP% LSS 7 set OKWMP=0
echo OKWMP=%OKWMP%