可以配合域策略自动下发执行, 批量收集域内电脑配置;

手动执行亦可; 如下保存成.bat批处理文件执行即可.

/*&cls&echo off&cd /d "%~dp0"
rem 功能: 获取本机系统及硬件配置信息
rem 日期:2022.08.10
rem 制作人:zl set #=获取本机系统及硬件配置信息
set _=百川盈孚
set $=技术部
set z=Tel:59795659
(hostname)>>%temp%\temp.txt
set /p h=<%temp%\temp.txt
del /f /q %temp%\temp.txt
title %#% + %_%%$% + %z%
set y=%date:~0,4%%date:~5,2%%date:~8,2%
type "%~f0"|cscript -nologo -e:jscript "%~f0">"%tmp%\v.v"
cscript -nologo -e:vbscript "%tmp%\v.v" 2>%h%_%y%_info.log echo .
echo .. echo /-----------------------------------------------\
echo 请查看当前目录下的 %h%_%y%_info.log
echo \-----------------------------------------------/ echo ..
echo .
pause
rem start %h%_%y%_info.log
exit
*/
var text=WSH.StdIn.ReadAll();
var vbs=text.match(/\/\*\r\n([\s\S]+)\*\/\s*$/);
WSH.echo(vbs[1]);
/* On Error Resume Next
Set fso=CreateObject("Scripting.Filesystemobject")
Set ws=CreateObject("WScript.Shell")
Set wmi=GetObject("winmgmts:\\.\root\cimv2") WSH.echo " 系统信息收集中, 请稍等..."
WSH.echo "=============================" WSH.StdErr.WriteLine '\n'
WSH.StdErr.WriteLine "============系统信息============"
Set query=wmi.ExecQuery("Select * from Win32_ComputerSystem")
For each item in query
WSH.StdErr.WriteLine "当前用户="& item.UserName
WSH.StdErr.WriteLine "工作组=" & item.Workgroup
WSH.StdErr.WriteLine "域=" & item.Domain
WSH.StdErr.WriteLine "计算机名=" & item.Name
WSH.StdErr.WriteLine "系统类型=" & item.SystemType
Next Set query=wmi.ExecQuery("Select * from Win32_OperatingSystem")
For each item in query
WSH.StdErr.WriteLine "系统=" & item.Caption & "[" & item.Version & "]"
WSH.StdErr.WriteLine "初始安装日期=" & item.InstallDate
visiblemem=item.TotalVisibleMemorySize
virtualmem=item.TotalVirtualMemorySize
Next WSH.StdErr.WriteLine '\n'
WSH.StdErr.WriteLine "============主板BIOS============"
Set query=wmi.ExecQuery("Select * from Win32_ComputerSystemProduct")
For each item in query
WSH.StdErr.WriteLine "制造商=" & item.Vendor
WSH.StdErr.WriteLine "型号=" & item.Name
Next Set query=wmi.ExecQuery("Select * from Win32_BIOS")
For each item in query
WSH.StdErr.WriteLine "名称=" & item.Name
WSH.StdErr.WriteLine "bios制造商=" & item.Manufacturer
WSH.StdErr.WriteLine "发布日期=" & item.ReleaseDate
WSH.StdErr.WriteLine "版本=" & item.SMBIOSBIOSVersion
Next WSH.StdErr.WriteLine '\n'
WSH.StdErr.WriteLine "============CPU信息============"
Set query=wmi.ExecQuery("Select * from WIN32_PROCESSOR")
For each item in query
WSH.StdErr.WriteLine "序号=" & item.DeviceID
WSH.StdErr.WriteLine "名称=" & item.Name
WSH.StdErr.WriteLine "核心=" & item.NumberOfCores
WSH.StdErr.WriteLine "线程=" & item.NumberOfLogicalProcessors
Next WSH.StdErr.WriteLine '\n'
WSH.StdErr.WriteLine "============内存============"
WSH.StdErr.WriteLine "总物理内存=" & FormatNumber(visiblemem/1048576,2,True) & " GB"
WSH.StdErr.WriteLine "总虚拟内存=" & FormatNumber(virtualmem/1048576,2,True) & " GB"
Set query=wmi.ExecQuery("Select * from Win32_PhysicalMemory")
For each item in query
WSH.StdErr.WriteLine "序号=" & item.Tag
WSH.StdErr.WriteLine "容量=" & FormatSize(item.Capacity)
WSH.StdErr.WriteLine "主频=" & item.Speed
WSH.StdErr.WriteLine "制造商=" & item.Manufacturer
Next WSH.StdErr.WriteLine '\n'
WSH.StdErr.WriteLine "============物理硬盘============"
Set query=wmi.ExecQuery("Select * from Win32_DiskDrive")
For each item in query
WSH.StdErr.WriteLine "名称=" & item.Caption
WSH.StdErr.WriteLine "接口=" & item.InterfaceType
WSH.StdErr.WriteLine "容量=" & FormatSize(item.Size)
WSH.StdErr.WriteLine "分区数=" & item.Partitions
WSH.StdErr.WriteLine '\n'
Next WSH.StdErr.WriteLine "============硬盘逻辑分区============"
Set query=wmi.ExecQuery("Select * from Win32_LogicalDisk Where DriveType=3 or DriveType=2")
For each item in query
WSH.StdErr.WriteLine item.Caption & Chr(9) & item.FileSystem & Chr(9) & FormatSize(item.Size) & Chr(9) & FormatSize(item.FreeSpace)
Next WSH.StdErr.WriteLine '\n'
WSH.StdErr.WriteLine "============网卡============"
Set query=wmi.ExecQuery("Select * from Win32_NetworkAdapter Where NetConnectionID !=null and not Name like '%Virtual%'")
For each item in query
WSH.StdErr.WriteLine "名称=" & item.Name
WSH.StdErr.WriteLine "连接名=" & item.NetConnectionID
WSH.StdErr.WriteLine "MAC=" & item.MACAddress
Set query2=wmi.ExecQuery("Select * from Win32_NetworkAdapterConfiguration Where Index=" & item.Index)
For each item2 in query2
If typeName(item2.IPAddress) <> "Null" Then
WSH.StdErr.WriteLine "IP=" & item2.IPAddress(0)
End If
Next
WSH.StdErr.WriteLine '\n'
Next WSH.StdErr.WriteLine '\n'
WSH.StdErr.WriteLine "============显卡============"
Set query=wmi.ExecQuery("Select * from Win32_VideoController")
For each item in query
WSH.StdErr.WriteLine "名称=" & item.Name
WSH.StdErr.WriteLine "显存=" & FormatSize(Abs(item.AdapterRAM))
WSH.StdErr.WriteLine "当前刷新率=" & item.CurrentRefreshRate
WSH.StdErr.WriteLine "水平分辨率=" & item.CurrentHorizontalResolution
WSH.StdErr.WriteLine "垂直分辨率=" & item.CurrentVerticalResolution
WSH.StdErr.WriteLine '\n'
Next WSH.StdErr.WriteLine '\n'
WSH.StdErr.WriteLine "============声卡============"
Set query=wmi.ExecQuery("Select * from WIN32_SoundDevice")
For each item in query
WSH.StdErr.WriteLine item.Name
Next WSH.StdErr.WriteLine '\n'
WSH.StdErr.WriteLine "============打印机============"
Set query=wmi.ExecQuery("Select * from Win32_Printer")
For each item in query
If item.Default =True Then
WSH.StdErr.WriteLine item.Name & "(默认)"
Else
WSH.StdErr.WriteLine item.Name
End If
Next WSH.echo " 电脑信息已经收集完成!"
WSH.echo "============================"
WSH.Quit Function FormatSize(byVal t)
If t >= 1099511627776 Then
FormatSize = FormatNumber(t/1099511627776, 2, true) & " TB"
ElseIf t >= 1073741824 Then
FormatSize = FormatNumber(t/1073741824, 2, true) & " GB"
ElseIf t >= 1048576 Then
FormatSize = FormatNumber(t/1048576, 2, true) & " MB"
ElseIf t >= 1024 Then
FormatSize = FormatNumber(t/1024, 2, true) & " KB"
Else
FormatSize = t & " B"
End If
End Function */

DOS批处理命令,自动获取本机系统及硬件配置信息的更多相关文章

  1. DOS批处理命令判断操作系统版本、执行各版本对应语句

    DOS批处理命令判断操作系统版本.执行各版本对应语句   昨天在家里试用  netsh interface ip set address 这些命令更改上网IP.DNS.网关等,今天将那些代码拿来办公室 ...

  2. DOS批处理命令递归删除给定的文件(夹),兼VC工程清理小工具

    使用dos批处理命令递归删除指定的文件(夹): (下面内容针对清理VC工程!自己按说明任意修改) 2014-06-10修改:删除前增加了[y,n]询问: echo off rem 递归删除当前文件下指 ...

  3. Shell 命令行获取本机IP,grep的练习

    Shell 命令行获取本机IP,grep的练习 在 mac 下面输入 ifconfig 或者在 linux 下面输入 ip a 就可以得到我们的网卡信息.不过通常情况下,我们需要查看的是我们的IP地址 ...

  4. C/C++通过WMI和系统API函数获取获取系统硬件配置信息

    转载:http://www.cnblogs.com/renyuan/archive/2012/12/29/2838716.html 转载:http://blog.csdn.net/jhqin/arti ...

  5. Linux命令之lsb_release - 查看当前系统的发行版信息

    用途说明 lsb_release命令用来查看当前系统的发行版信息(prints certain LSB (Linux Standard Base) and Distribution informati ...

  6. C#程序中获取电脑硬件配置信息的一种方法

    本文介绍获取cpu信息和内存信息的方法,根据本文所举例的代码可以举一反三获取更多信息. 获取cpu名称的方法: public string GetCpuInfo() { ManagementObjec ...

  7. .NetCore获取Json和Xml格式的配置信息

    本篇将和大家分享的是:如何获取Json和Xml格式的配置信息,主要介绍的是Configuration扩展方法的使用,因为netcore的web应用在Startup中已经默认嵌入appsettings. ...

  8. cocos2d-x教程3:用php或DOS批处理命令来转换文件和解压缩zip

    在cocos2d-x使用中,须要不停的转换文件和压缩或解压文件.假设全人工来做,太麻烦了,且easy出错. 我如今把一些用的到批处理贴出来,供大家使用 自己主动把dat文件按数字排序重命名gz.DOS ...

  9. DOS批处理命令-几个固定名称的变量

    批处理中有一些变量的变量名称是固定的,具有特定的意义,接下来,我们来看看这些有特定意义的变量到底有什么意义. 1.%CD%   当前路径的路径名[盘符 + 路径]    - 現在のディレクトリ文字列に ...

  10. DOS批处理命令-if语句

    IF语句是批处理中执行的条件分歧处理. 批处理中,IF分歧的写法有好几种,接下来,我们来一个一个的分析IF语法的结构. 1.IF [NOT] ERRORLEVEL 番号 批处理命令 当ERRORLEV ...

随机推荐

  1. Hugging Face 每周速递: Space 支持创建模版应用、Hub 搜索功能增强、BioGPT-Large 还有更多

    每一周,我们的同事都会向社区的成员们发布一些关于 Hugging Face 相关的更新,包括我们的产品和平台更新.社区活动.学习资源和内容更新.开源库和模型更新等,我们将其称之为「Hugging Ne ...

  2. 解决Connecting to 127.0.0.1:8118... failed: Connection refused.

    这里是代理问题的锅 $ env|grep -I proxy http_proxy=http://127.0.0.1:8118 ftp_proxy=http://127.0.0.1:8118 https ...

  3. MySQL线程池、连接池等概念

    一.MySQL连接池 1 连接池通常实现在client端,是指应用(客户端)预先创建一定的连接,利用这些连接服务于客户端所有的DB请求. 2 如果某一个时刻,空闲的连接数小于DB的请求数,则需要将请求 ...

  4. 隐藏来源 禁用Referrer 的方法

    原文链接: https://www.cnblogs.com/duanweishi/p/16490197.html https://blog.csdn.net/qq996150938/article/d ...

  5. 【C学习笔记】day4-3 求Sn=a+aa+aaa+aaaa+aaaaa的前5项之和,其中a是一个数字

    求Sn=a+aa+aaa+aaaa+aaaaa的前5项之和,其中a是一个数字, 例如:2+22+222+2222+22222 #include <stdio.h> #include < ...

  6. PHP中的超级变量

    超级变量,又名超级全局变量,是PHP内置的变量,这些变量在代码的任意位置都能正常使用 PHP中的超级变量 9种超级变量 $GLOBALS $_SERVER 9种超级变量 目前,PHP提供了9种超级变量 ...

  7. Windows10使用VMware安装centos

    系统环境: Windows 10 安装步骤: 1.下载centos http://mirrors.aliyun.com/centos/ 2.使用VMware安装centos 3.配置网络 $ cd / ...

  8. random及循环

    题目:使用两种方式求2-20之间偶数的和,分别使用for和while 1.使用for解法: sum=0 for i in range(2,21,2): sum+=i print ("2-20 ...

  9. Transformers Pipelines

    pipelines 是使用模型进行推理的一种很好且简单的方法.这些pipelines 是从库中抽象出大部分复杂代码的对象,提供了一个简单的API,专门用于多个任务,包括命名实体识别.屏蔽语言建模.情感 ...

  10. Oracle 验证身份证号

    --验证身份证号是否正确CREATE OR REPLACE FUNCTION fn_checkidcard (p_idcard IN VARCHAR2) RETURN INT IS v_regstr ...