现在的位置: 首页 > 综合 > 正文

用批处理判断操作系统是32位还是64位,并注册install服务。

2013年08月22日 ⁄ 综合 ⁄ 共 382字 ⁄ 字号 评论关闭

@echo off
if /i "%PROCESSOR_IDENTIFIER:~0,3%" == "X86" goto 1
/////通过参数判定操作系统位数,并跳转
if /i "%PROCESSOR_IDENTIFIER:~0,3%" NEQ "X86" goto 2
///此条语句后面可以改为 EQU "EM6"
:1 
/////32位xp注册install服务
%windir%\system32\msiexec.exe /regserver exit

:2  /////64位xp注册install服务
%windir%\syswow64\msiexec.exe /regserver
%windir%\system32\msiexec.exe /unreg
%windir%\system32\msiexec.exe /regserver
exit
由于本单位内部系统定制为xp,所以判定不是x86的都是64位。

抱歉!评论已关闭.