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

手动执行亦可; 如下保存成.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. GeoServer发布MySQL空间数据

    1. 概述 MySQL是常用的关系型数据库,MySQL遵从OpenGIS联盟(OGC)的规范,实施了空间扩展,更详细的信息可以参考: MySQL :: MySQL 8.0 Reference Manu ...

  2. LeetCode-28 实现strStr() KMP算法的学习

    来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/repeated-string-match 题目描述 给定两个字符串 a 和 b,寻找重复叠加字符 ...

  3. python ( 进阶 第一部 )

    目录 列表的相关操作与函数 字符串的相关操作与函数 集合相关操作与函数 字典相关操作与函数 深浅拷贝 文件操作 列表的相关操作 列表的拼接 lst1 = [1,2,3] lst2 = [4,5,6,6 ...

  4. java学习日记20230301-API文档

    JAVA API java application programming interinterface  应用程序编程接口,是java提供的基本编程接口 在线文档:https://www.matoo ...

  5. 随机颜色,加载loading效果,节流,应用周期函数,wxs

    随机颜色 data: { colorList:[] }, getColor(){ wx.request({ url: 'https://www.escook.cn/api/color', method ...

  6. Execution failed for task ':app:checkDebugDuplicateClasses'解决办法

    A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable & ...

  7. 面向对象程序设计A第一次blog

    一.前言 第一次题目集总结-- 题量:较多 难度:较低 知识点: 简单的输入输出 一些简单的运算和类型转换 一些简单的循环.选择.字符串.数组的使用 总结:题目比较简单,题量较多,内容就是一些简单的输 ...

  8. 【1】第一篇 Postman的初级使用之设置环境快速切换生成环境与测试环境

    POSTMAN是有谷歌的开源工具,在开发调试.测试执行过程中使用频率非常广泛,本文将记录一些postman在测试中常见的一些配置和使用方法 一.基本的页面区域 略,很简单,大家都会看,再有,学习下面的 ...

  9. 【Direct3D 12】配置编译环境

    创建桌面应用程序 使用Visual Studio Community 2019创建一个桌面应用程序. 配置SDK版本.头文件.依赖库 右键单击创建的项目名称,选择Properties. 在Config ...

  10. netstate查找端口占用

    netstat -nao 列出本机端口占用信息加上|findstr 筛选 各个字段的意思: 协议  本地地址:端口          外部地址:端口        状态           PID 这 ...