PC 配置参数查看bat

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

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

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

System Information、DisplayCard

Mother Board、Hard Disk、Network Card

Software Information、USB Information

Users、FileShare Information

以下为代码:

@echo off
color 57
title HardSoft Viewer
mode con cols=67 lines=42
setlocal  ENABLEDELAYEDEXPANSION
echo Prepare For View ...
del /f "%TEMP%\temp.txt" 2>nul
dxdiag /t %TEMP%\temp.txt
del /f "%COMPUTERNAME%.txt" 2>nul
echo Start Hardware Viewer ...
echo System Information: >>%COMPUTERNAME%.txt
:system
rem 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=0
echo.>>%COMPUTERNAME%.txt
echo Mother Board:>>%COMPUTERNAME%.txt
for /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%.txt
echo Hard Disk: >>%COMPUTERNAME%.txt
for /f "skip=2 tokens=*" %%a in (‘wmic DISKDRIVE get model ^,size /value‘) do (
   echo.      %%a>>%COMPUTERNAME%.txt
)

set tee=0
echo.>>%COMPUTERNAME%.txt
echo Network Card:>>%COMPUTERNAME%.txt
for /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
:xp
for /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%.txt
echo Software Information:>>%COMPUTERNAME%.txt
for /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%.txt
if 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%.txt
echo USB Information:>>%COMPUTERNAME%.txt
for /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

:win7
for /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 win7
echo.>>%COMPUTERNAME%.txt
echo Software Information:>>%COMPUTERNAME%.txt
for /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%.txt
echo USB Information:>>%COMPUTERNAME%.txt
for /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
)

:last
echo ==================================================================
echo Admin Users:
echo.>>%COMPUTERNAME%.txt
echo Admin Users:>>%COMPUTERNAME%.txt
for /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%.txt
echo Power Users:>>%COMPUTERNAME%.txt
for /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%.txt
echo FileShare Information:>>%COMPUTERNAME%.txt
for /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>nul
copy %COMPUTERNAME%.txt \\192.168.1.1\HardFile$net use \\192.168.1.1\IPC$ /del 1>nul 2>nul
pause
start %COMPUTERNAME%.txt

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

时间: 2024-10-12 04:17:56

PC 配置参数查看bat的相关文章

Hadoop2.6.0配置参数查看小工具

前言 使用Hadoop进行离线分析或者数据挖掘的工程师,经常会需要对Hadoop集群或者mapreduce作业进行性能调优.也许你知道通过浏览器访问http://master:18088/conf来查看配置信息,如下图所示: 但是当Linux工程师们只面对命令行时,如何查看呢?而且如果运维工程师根据集群状况及运行历史使用shell.Python.ruby等脚本写些运维代码,甚至动态调整集群参数时,该怎么办呢?性能调优的前提是需要能准确知道目前针对Hadoop集群或者mapreduce作业配置的参

通过查看mysql 配置参数、状态来优化你的mysql

mysql的监控方法大致分为两类: 1.连接到mysql数据库内部,使用show status,show variables,flush status 来查看mysql的各种性能指标. 2. 直接使用mysqladmin查看其性能指标,例如: UserParameter=mysql.uptime,mysqladmin -uroot status|cut -f2 -d":"|cut -f1 -d"T" mysqladmin两个参数,status,extended-st

mysql 通过查看mysql 配置参数、状态来优化你的mysql

我把MYISAM改成了INNODB,数据库对CPU方面的占用变小很多' mysql的监控方法大致分为两类: 1.连接到mysql数据库内部,使用show status,show variables,flush status 来查看mysql的各种性能指标. 2. 直接使用mysqladmin查看其性能指标,例如: UserParameter=mysql.uptime,mysqladmin -uroot status|cut -f2 -d":"|cut -f1 -d"T&quo

路由器+交换机基本命令配置参数

模式的介绍 用户模式   Router> enable                          只能简单的查看设备 特权模式   R1#config terminal                可以查看所有配置,但不能修改 全局模式   R1(config)#intface Fastehernet0/1   可以对设备进行任意配置,查看 exit:退后一步 end:在任何模式下退回到特权模式(Ctrl+Z快捷键) disable:特权模式退回用户模式 show MAC-addres

关于ntp时间同步理论及配置参数-20170804

[原创]关于ntp时间同步理论及配置参数20170804 前言 NTP(Network Time Protocol,网络时间协议)是用来使网络中的各个计算机时间同步的一种协议.无论是平时使用的私人计算机还是在工作中搭建的服务器集群,时间的统一性和准确性是十分重要的.它是用来同步网络中各个计算机的时间的协议. 在计算机的世界里,时间非常地重要,例如对于火箭发射这种科研活动,对时间的统一性和准确性要求就非常地高,是按照A这台计算机的时间,还是按照B这台计算机的时间?NTP就是用来解决这个问题的,NT

linux学习笔记——搭建基于nginx的web服务器、多核配置、nginx配置参数

############ 认识nginx #############Nginx:(发音同 engine x)是一款轻量级的Web服务器/反向代理服务器及电子邮件(IMAP/POP3)代理服务器,并在一个BSD-like 协议下发行.由俄罗斯的程序设计师Igor Sysoev所开发,最初供俄国大型的入口网站及搜寻引擎Rambler(俄文:Рамблер)使用.  其优点是轻量级(占有内存少),高并发(并发能力强),事实上nginx的并发能力确实在同类型的网页伺服器中表现较好.目前中国大陆使用ngi

笔记01 登录、常用配置参数、Action访问Servlet API 和设置Action中对象的值、命名空间和乱码处理、Action中包含多个方法如何调用

Struts2登录 1. 需要注意:Struts2需要运行在JRE1.5及以上版本 2. 在web.xml配置文件中,配置StrutsPrepareAndExecuteFilter或FilterDispatcher 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 <filter>     <filter-name>struts2</filter-name>     <filter-class>org.apache.struts2.di

Java虚拟机配置参数(目前不够完善)

最近看了有关虚拟机的书籍,发现有很多虚拟机配置参数不知道,特来记录一下, -XX: MaxDirectMemorySize--->设置直接内存,不设置与Java堆内存最大值一致 -XX:PermSize和-XX:MaxPermSize--->设置方法区大小 -Xoss--->设置本地方法栈大小 -XX:+HeapDumpOnOutOfMemoryError--->生成内存溢出快照(查看内存溢出快照的工具,安装JDK时,有自带了几种工具,具体怎么使用百度.谷歌) -XX:+/-Use

eAccelerator 配置参数详解

eAccelerator 配置参数详解 eaccelerator.shm_size="32" eAccelerator 可以使用的共享内存的数量 (以兆为单位) . "0" 是指操作系统的默认值. 默认值是 "0".可根据服务器的实际情况来调整,16,32,64,128都是可以的. eaccelerator.cache_dir="/home/php/tmp" 这个目录是给磁盘缓存使用. eAccelerator 在这里储存预先