Batch file check office architecture version

ⅰ亾dé卋堺 提交于 2019-12-02 08:41:21

问题


i have the following script, that will print the current version of office and the architecture of the OS,

   Echo off&SetLocal
Set "KEY="&Set "GUID="&Set "IOV="&Set "MWB=32"&Set "MOB=32"
Echo=%PROCESSOR_ARCHITECTURE% %PROCESSOR_ARCHITEW6432%|Find "64">Nul&&(
   Set "KEY=\Wow6432Node"&Set "MWB=64")
Set "KEY=HKLM\Software%KEY%\Microsoft\Windows\CurrentVersion\Uninstall"
For /f "Delims=" %%a In ('Reg Query %KEY% /k /f "*-001B-*0FF1CE}"') Do (
   If Not Defined GUID Set "GUID=%%~nxa")
If Not Defined GUID (Echo=Unable to find Office Product&GoTo :EndIt)
If %GUID:~20,1% Equ 1 Set "MOB=64"
If %GUID:~4,1% Equ 4 (Set IOV=10) Else (If %GUID:~4,1% Equ 2 (Set IOV=07) Else (
      If %GUID:~4,1% Equ 5 (Set IOV=13) Else (Set IOV=??)))
Echo=&Echo= Office 20%IOV% %MOB%-bit Product installed on a %MWB%-bit OS
:EndIt

i would like to customize this script to to make some other stuff if the output is like this Office 20?? 32-bit Product installed on a 64-bit OS

   If Echo= Office 2007 32-bit Product installed on a 64-bit OS (run another script or command)

Can somebody help me implement this? Thanks in advance.


回答1:


Found the solution my self, IF %MOB%==32 IF %MWB%==64 (Echo commands)



来源:https://stackoverflow.com/questions/35820375/batch-file-check-office-architecture-version

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!