Windows 如何使用if-else语句查找视频适配器名称使用*.bat文件

Windows 如何使用if-else语句查找视频适配器名称使用*.bat文件,windows,batch-file,cmd,wmic,win32-process,Windows,Batch File,Cmd,Wmic,Win32 Process,弄不清是怎么回事,请帮忙 主要目标如下(伪代码): 但这需要在*.bat文件中完成,我是这方面的新手,这是我的尝试: SETLOCAL ENABLEDELAYEDEXPANSION SET count=1 FOR /F "usebackq tokens=* skip=1" %%F IN (`wmic PATH Win32_videocontroller GET description`) DO ( SET var!count!=%%F SET /a count=!count!+1 ) E

弄不清是怎么回事,请帮忙

主要目标如下(伪代码):

但这需要在*.bat文件中完成,我是这方面的新手,这是我的尝试:

SETLOCAL ENABLEDELAYEDEXPANSION
SET count=1
FOR /F "usebackq tokens=* skip=1" %%F IN (`wmic PATH Win32_videocontroller GET description`) DO (
  SET var!count!=%%F
  SET /a count=!count!+1
)
ECHO %var1%
ECHO %var2%
Findstr /c:%var1% listNameVideoAdapters.txt 
ENDLOCAL
if %errorlevel%==0 (
echo "True")
if %errorlevel%==1 (
echo "Falsee!")
pause
wmic路径Win32\u视频控制器获取描述-返回
返回:

Description
NVIDIA GeForce GT 720M
Intel(R) HD Graphics 4000

listNameVideoAdapters.txt
包含具有不同视频卡名称的列表(包括我的NVIDIA GeForce GT 720M)

无需
for
循环:

wmic PATH Win32_videocontroller GET description |findstr /g:listNameVideoAdapters.txt >nul && echo True || echo False

findstr/g
获取要从文件(您已经拥有)中搜索的字符串列表

无需
for
循环:

wmic PATH Win32_videocontroller GET description |findstr /g:listNameVideoAdapters.txt >nul && echo True || echo False

findstr/g
获取要从文件(您已经拥有)中搜索的字符串列表。

请提供您的
listNameVideoAdapters.txt
的内容。至少,请解释列表中的项目是完全匹配的完整字符串还是部分字符串?文件使用哪种格式(布局和类型信息),以及该列表中有多少项的指示?请提供
listNameVideoAdapters.txt
的内容。至少,请解释列表中的项目是完全匹配的完整字符串还是部分字符串?文件使用哪种格式(布局和类型信息),以及该列表中有多少项的指示?