网上搜到的一个代码- @echo off
- setlocal enabledelayedexpansion
- for /l %%a in (8,1,12) do (
- reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\%%a.0\Common\LanguageResources /v SKULanguage>nul 2>nul
- if !errorlevel!==0 (
- if %%a==8 (
- set OffiVer=Office 97
- ) else if %%a==9 (
- set OffiVer=Office 2000
- ) else if %%a==10 (
- set OffiVer=Office XP
- ) else if %%a==11 (
- set OffiVer=Office 2003
- ) else if %%a==12 (
- set OffiVer=Office 2007
- ) else (
- set OffiVer=其它
- )
- )
- )
- for /f "tokens=2 delims=x" %%a in ('reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\11.0\Common\LanguageResources /v SKULanguage') do (
- if %%a==409 (
- set OffiLan=英文
- ) else if %%a==2052 (
- set OffiLan=中文
- ) else (
- set OffiLan=其它
- )
- )
- echo Office版本:%OffiVer%
- echo Office语言版本:%OffiLan%
- pause
复制代码
|