批处理文件检查Office版本的架构 [英] Batch file check office architecture version

查看:356
本文介绍了批处理文件检查Office版本的架构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下脚本,将打印的办公当前版本和操作系统的架构,

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

我想自定义此脚本,做一些其他的东西,如果输出是这个样子
办公室20?在64位操作系统上安装了32位产品。

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.

推荐答案

找到了解决办法我自己,
IF%MOB%== 32 IF%MWB%== 64(回声命令)

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

这篇关于批处理文件检查Office版本的架构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆