if exist !sysdrive-%%b!\Windows\SysWOW64 (set osarch-%%b=x64) else if not exist !sysdrive-%%b!\Windows\SysWOW64 (set osarch-%%b=x86) else set "osarch-%%b=???"
)
rem 查询系统版本号,
for /f "tokens=3" %%c in ('reg query "!reg_load_system_%%b!\Setup\Service Reporting API\Components\CoreOS" /v Version 2^>nul ^| findstr /i "REG_SZ"') do set ver-%%b=%%c
rem 如果上面未查询到版本号,则在此处查询
if not defined ver-%%b (
for /f "tokens=3" %%f in ('reg query "!reg_load_software_%%b!\Microsoft\Windows NT\CurrentVersion" /v CurrentVersion 2^>nul ^| findstr /i "REG_SZ"') do set ver-%%b=%%f
for /f "tokens=3" %%g in ('reg query "!reg_load_software_%%b!\Microsoft\Windows NT\CurrentVersion" /v CurrentBuildNumber 2^>nul ^| findstr /i "REG_SZ"') do set ver-%%b=!ver-%%b!.%%g
)
rem 查询系统名称
for /f "tokens=3*" %%d in ('reg query "!reg_load_software_%%b!\Microsoft\Windows NT\CurrentVersion" /v ProductName 2^>nul ^| findstr /i "REG_SZ"') do set name-%%b=%%d %%e