Board logo

标题: 最准确的64位和32位判断,前提是不能被垃圾软件或是病毒更改 [打印本页]

作者: /zhqsystem/zhq    时间: 2015-7-28 04:37     标题: 最准确的64位和32位判断,前提是不能被垃圾软件或是病毒更改

本帖最后由 /zhqsystem/zhq 于 2015-7-28 05:45 编辑
  1. for /f "delims=" %%i in ('reg query "hklm\system\controlset001\control\session manager\environment" /v "processor_architecture"^|findstr/i "reg_"') do (
  2. for /f "delims=" %%j in ('reg query "hklm\system\controlset002\control\session manager\environment" /v "processor_architecture"^|findstr/i "reg_"') do (
  3. for /f "delims=" %%k in ('reg query "hklm\system\currentcontrolset\control\session manager\environment" /v "processor_architecture"^|findstr/i "reg_"') do (
  4. if /i "%%i"=="%%j" if /i "%%j"=="%%k" if /i "%%k"=="%%i" (
  5.   echo=数值互等执行判断
  6.   echo=%%i|findstr/i "64">nul2>nul||echo=%%i|findstr/i "86">nul2>nul||(echo=所有的判断值值错误,5秒退出&&ping /n 5 127.1 >nul2>nul&&exit)
  7.   echo=%%j|findstr/i "64">nul2>nul||echo=%%j|findstr/i "86">nul2>nul||(echo=所有的判断值值错误,5秒退出&&ping /n 5 127.1 >nul2>nul&&exit)
  8.   echo=%%k|findstr/i "64">nul2>nul||echo=%%k|findstr/i "86">nul2>nul||(echo=所有的判断值值错误,5秒退出&&ping /n 5 127.1 >nul2>nul&&exit)
  9.   echo=%%i|findstr/i "64">nul2>nul&&(set system_bit=64&echo=当前系统位宽:  64位)
  10.   echo=%%i|findstr/i "86">nul2>nul&&(set system_bit=32&echo=当前系统位宽:  32位)
  11.   )
  12. if /i not "%%i"=="%%j" (
  13.   echo=错误对比 i j
  14.   echo=%%i
  15.   echo=%%j
  16.   echo/
  17.   )
  18. if /i not "%%j"=="%%k" (
  19.   echo=错误对比 j k
  20.   echo=%%j
  21.   echo=%%k
  22.   echo/
  23. )
  24. if /i not "%%k"=="%%i" (
  25.   echo=错误对比 k i
  26.   echo=%%k
  27.   echo=%%i
  28.   echo/
  29. )
  30. )))
  31. reg query "hklm\system\controlset001\control\session manager\environment" /v "processor_architecture"|findstr/i "64">nul2>nul&&(set system_bit=64&echo=当前系统位宽:  64位)
  32. reg query "hklm\system\controlset001\control\session manager\environment" /v "processor_architecture"|findstr/i "86">nul2>nul&&(set system_bit=32&echo=当前系统位宽:  32位)
复制代码

说明 最后两个是没有错误时直接用的




欢迎光临 批处理之家 (http://www.bathome.net/) Powered by Discuz! 7.2