本帖最后由 /zhqsystem/zhq 于 2015-7-28 05:45 编辑
- for /f "delims=" %%i in ('reg query "hklm\system\controlset001\control\session manager\environment" /v "processor_architecture"^|findstr/i "reg_"') do (
- for /f "delims=" %%j in ('reg query "hklm\system\controlset002\control\session manager\environment" /v "processor_architecture"^|findstr/i "reg_"') do (
- for /f "delims=" %%k in ('reg query "hklm\system\currentcontrolset\control\session manager\environment" /v "processor_architecture"^|findstr/i "reg_"') do (
- if /i "%%i"=="%%j" if /i "%%j"=="%%k" if /i "%%k"=="%%i" (
- echo=数值互等执行判断
- echo=%%i|findstr/i "64">nul2>nul||echo=%%i|findstr/i "86">nul2>nul||(echo=所有的判断值值错误,5秒退出&&ping /n 5 127.1 >nul2>nul&&exit)
- echo=%%j|findstr/i "64">nul2>nul||echo=%%j|findstr/i "86">nul2>nul||(echo=所有的判断值值错误,5秒退出&&ping /n 5 127.1 >nul2>nul&&exit)
- echo=%%k|findstr/i "64">nul2>nul||echo=%%k|findstr/i "86">nul2>nul||(echo=所有的判断值值错误,5秒退出&&ping /n 5 127.1 >nul2>nul&&exit)
- echo=%%i|findstr/i "64">nul2>nul&&(set system_bit=64&echo=当前系统位宽: 64位)
- echo=%%i|findstr/i "86">nul2>nul&&(set system_bit=32&echo=当前系统位宽: 32位)
- )
- if /i not "%%i"=="%%j" (
- echo=错误对比 i j
- echo=%%i
- echo=%%j
- echo/
- )
- if /i not "%%j"=="%%k" (
- echo=错误对比 j k
- echo=%%j
- echo=%%k
- echo/
- )
- if /i not "%%k"=="%%i" (
- echo=错误对比 k i
- echo=%%k
- echo=%%i
- echo/
- )
- )))
- reg query "hklm\system\controlset001\control\session manager\environment" /v "processor_architecture"|findstr/i "64">nul2>nul&&(set system_bit=64&echo=当前系统位宽: 64位)
- reg query "hklm\system\controlset001\control\session manager\environment" /v "processor_architecture"|findstr/i "86">nul2>nul&&(set system_bit=32&echo=当前系统位宽: 32位)
复制代码
说明 最后两个是没有错误时直接用的 |