首页 > 代码库 > PC 配置参数查看bat

PC 配置参数查看bat

快速查看计算机参数配置信息

直接将代码保存为bat,直接执行。

主要包括计算机以下详细信息:

System Information、DisplayCard 

Mother Board、Hard Disk、Network Card

Software Information、USB Information

Users、FileShare Information

 

 

 

以下为代码:

@echo offcolor 57title HardSoft Viewermode con cols=67 lines=42setlocal  ENABLEDELAYEDEXPANSIONecho Prepare For View ...del /f "%TEMP%\temp.txt" 2>nuldxdiag /t %TEMP%\temp.txtdel /f "%COMPUTERNAME%.txt" 2>nulecho Start Hardware Viewer ...echo System Information: >>%COMPUTERNAME%.txt:systemrem This must 30s if EXIST "%TEMP%\temp.txt" (    for /f "tokens=1,2,* delims=:" %%a in (‘findstr /c:" Machine name:" /c:" Operating System:" /c:" System Model:" /c:" Processor:" /c:"  Memory:" /c:" Card name:" /c:"Display Memory:" "%TEMP%\temp.txt"‘) do (         set /a tee+=1     if !tee! == 1 echo       Computer Name = %%b>>%COMPUTERNAME%.txt     if !tee! == 2 echo       OS       Type = %%b>>%COMPUTERNAME%.txt     if !tee! == 3 echo       System  Model = %%b>>%COMPUTERNAME%.txt         if !tee! == 4 echo       CPU     Model = %%b>>%COMPUTERNAME%.txt     if !tee! == 5 echo       RAM      Size = %%b>>%COMPUTERNAME%.txt     if !tee! == 6 echo.>>%COMPUTERNAME%.txt     if !tee! == 6 echo DisplayCard : >>%COMPUTERNAME%.txt         if !tee! == 6 echo       Display  Card = %%b>>%COMPUTERNAME%.txt    if !tee! == 7 echo       DisplayMemory = %%b>>%COMPUTERNAME%.txt)   ) else (    ping /n 2 127.1>nul    goto system)set tee=0echo.>>%COMPUTERNAME%.txtecho Mother Board:>>%COMPUTERNAME%.txtfor /f "tokens=1,* delims==" %%a in (‘wmic BASEBOARD get Manufacturer^,Product^,Version^,SerialNumber /value‘) do (     set /a tee+=1     if "!tee!" == "3" echo       Manufacturer     = %%b>>%COMPUTERNAME%.txt     if "!tee!" == "4" echo       MotherBoard Model= %%b>>%COMPUTERNAME%.txt )set tee=0 )echo.>>%COMPUTERNAME%.txtecho Hard Disk: >>%COMPUTERNAME%.txtfor /f "skip=2 tokens=*" %%a in (‘wmic DISKDRIVE get model ^,size /value‘) do (   echo.      %%a>>%COMPUTERNAME%.txt) set tee=0 echo.>>%COMPUTERNAME%.txtecho Network Card:>>%COMPUTERNAME%.txtfor /f "tokens=2* delims==:" %%a in (‘ipconfig/all^|find /i "Description" ^| findstr /v "Microsoft" ^| findstr /v "Tunneling"‘) do (   set  name=%%a    echo      NetCard Model = %%a>>%COMPUTERNAME%.txt)for /f "tokens=2* delims==:" %%a in (‘ipconfig/all^|find /i "Physical Address" ^| findstr /v "00-00-00-00"‘) do (    set  name=%%a    echo      MAC Address = %%a>>%COMPUTERNAME%.txt)for /f "tokens=2* delims==:" %%a in (‘ipconfig/all^|find /i "描述" ^| findstr /v "Microsoft" ^| findstr /v "Tunneling"‘) do (    set  name=%%a    echo      NetCard Model = %%a>>%COMPUTERNAME%.txt)for /f "tokens=2* delims==:" %%a in (‘ipconfig/all^|find /i "物理地址" ^| findstr /v "00-00-00-00"‘) do (    set  name=%%a    echo      MAC Address = %%a>>%COMPUTERNAME%.txt) ver|find /i "windows xp">nul 2>nul&&goto xp||goto win7:xpfor /f "tokens=2* delims==:" %%a in (‘ipconfig/all^|find /i "IP Address"‘) do (    set  name=%%a    echo      IP Address = %%a>>%COMPUTERNAME%.txt)echo Start Software Viewer For XP...echo.>>%COMPUTERNAME%.txtecho Software Information:>>%COMPUTERNAME%.txtfor /f "tokens=7 delims=\" %%i in (‘reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" ^| findstr /v "KB" 2^>nul‘) do ( for /f "skip=4 tokens=2*" %%a in (‘reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\%%i" /v DisplayName 2^>nul‘ ) do (    echo %%b>>%COMPUTERNAME%.txt  ))for /f "tokens=2 delims=\" %%x in (‘reg query HKU‘) do (  for /f "tokens=8 delims=\" %%a in (‘reg query "HKU\%%x\Software\Microsoft\Windows\CurrentVersion\Uninstall" 2^>nul‘) do (     for /f "skip=4 tokens=2*" %%i in (‘reg query "HKU\%%x\Software\Microsoft\Windows\CurrentVersion\Uninstall\%%a"  /v "DisplayName" 2^>nul‘) do (      echo %%j>>%COMPUTERNAME%.txt     )  ))echo.>>%COMPUTERNAME%.txtif exist %windir%\system32\CCM\CcmExec.exe echo "SMS Client has been installed,please uninstall"if exist %windir%\system32\CCM\CcmExec.exe echo "SMS Client has been installed,please uninstall">>%COMPUTERNAME%.txt echo ==================================================================echo USB Information:echo.>>%COMPUTERNAME%.txtecho USB Information:>>%COMPUTERNAME%.txtfor /f "skip=4 tokens=2*" %%a in (‘reg query "HKLM\SYSTEM\CurrentControlSet\Services\usbstor" /v "start" 2^>nul‘ ) do (    if "%%b"=="0x4" echo     USB is Close    if "%%b"=="0x3" echo     USB is Open,Please Tag It.    if "%%b"=="0x4" echo     USB is Close>>%COMPUTERNAME%.txt    if "%%b"=="0x3" echo     USB is Open,Please Tag It.>>%COMPUTERNAME%.txt) goto last :win7for /f "tokens=2* delims==:" %%a in (‘ipconfig/all^|find /i "IPV4"‘) do (    set  name=%%a    echo      IP Address = %%a>>%COMPUTERNAME%.txt)echo Start Software Viewer For Win7/8 ...rem for 32 win7echo.>>%COMPUTERNAME%.txtecho Software Information:>>%COMPUTERNAME%.txtfor /f "tokens=7 delims=\" %%i in (‘reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" ^| findstr /v "KB" 2^>nul ‘) do (    for /f "skip=2 tokens=3* delims= " %%a in (‘reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\%%i" /v DisplayName 2^>nul‘) do (        echo %%a %%b>>%COMPUTERNAME%.txt    ))for /f "tokens=8 delims=\" %%i in (‘reg query "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall" 2^>nul ^| findstr /v "KB" 2^>nul ‘) do (    for /f "skip=2 tokens=3* delims= " %%a in (‘reg query "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\%%i" /v DisplayName 2^>nul‘) do (        echo %%a %%b>>%COMPUTERNAME%.txt    ))for /f "tokens=2 delims=\" %%x in (‘reg query HKU‘) do (  for /f "tokens=8 delims=\" %%a in (‘reg query "HKU\%%x\Software\Microsoft\Windows\CurrentVersion\Uninstall" 2^>nul‘) do (     for /f "skip=2 tokens=2*" %%i in (‘reg query "HKU\%%x\Software\Microsoft\Windows\CurrentVersion\Uninstall\%%a"  /v "DisplayName" 2^>nul‘) do (      echo %%j>>%COMPUTERNAME%.txt     )  )) for /f "tokens=2 delims=\" %%x in (‘reg query HKU‘) do (  for /f "tokens=9 delims=\" %%a in (‘reg query "HKU\%%x\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall" 2^>nul‘) do (     for /f "skip=2 tokens=2*" %%i in (‘reg query "HKU\%%x\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\%%a"  /v "DisplayName" 2^>nul‘) do (      echo %%j>>%COMPUTERNAME%.txt     )  ))  echo ==================================================================echo USB Information:echo.>>%COMPUTERNAME%.txtecho USB Information:>>%COMPUTERNAME%.txtfor /f "skip=2 tokens=2*" %%a in (‘reg query "HKLM\SYSTEM\CurrentControlSet\Services\usbstor" /v "start" 2^>nul‘ ) do (    if "%%b"=="0x4" echo     USB is Close    if "%%b"=="0x3" echo     USB is Open,Please Tag It.    if "%%b"=="0x4" echo     USB is Close>>%COMPUTERNAME%.txt    if "%%b"=="0x3" echo     USB is Open,Please Tag It.>>%COMPUTERNAME%.txt)   :lastecho ==================================================================echo Admin Users:echo.>>%COMPUTERNAME%.txtecho Admin Users:>>%COMPUTERNAME%.txtfor /f "skip=6 tokens=*" %%i in (‘net localgroup Administrators ^| findstr /v "㏑" ^| findstr /v "命" ^| findstr /v "command"‘) do (    echo       %%i    echo       %%i>>%COMPUTERNAME%.txt)echo Power Users:echo.>>%COMPUTERNAME%.txtecho Power Users:>>%COMPUTERNAME%.txtfor /f "skip=6 tokens=*" %%i in (‘net localgroup "Power Users" ^| findstr /v "㏑" ^| findstr /v "命" ^| findstr /v "command"‘) do (    echo       %%i    echo       %%i>>%COMPUTERNAME%.txt)echo ==================================================================echo FileShare Information:echo.>>%COMPUTERNAME%.txtecho FileShare Information:>>%COMPUTERNAME%.txtfor /f "skip=4 tokens=*" %%i in (‘net share 2^>nul ^| findstr /v "㏑" ^| findstr /v "命" ^| findstr /v "command"‘ ) do (   echo  %%i   echo  %%i>>%COMPUTERNAME%.txt )echo =========================Viewer Over==============================net use \\192.168.1.1 password /user:username 1>nul 2>nulcopy %COMPUTERNAME%.txt \\192.168.1.1\HardFile$net use \\192.168.1.1\IPC$ /del 1>nul 2>nulpausestart %COMPUTERNAME%.txt

  该代码源于网上收集,在这只提供分享。

 

PC 配置参数查看bat