如何通过批处理文件访问PC的资源?

时间:2012-02-10 03:17:56

标签: batch-file dos

有没有办法通过批量编程(DOS)访问计算机的内存,处理器速度和系统类型等物理资源?

1 个答案:

答案 0 :(得分:1)

wmic 命令可能会为您提供所需的功能。

以下是几个例子:

C:\> wmic computersystem get TotalPhysicalMemory
TotalPhysicalMemory
259497984

C:\> wmic cpu get name,MaxClockSpeed
MaxClockSpeed  Name
2393           Intel Celeron processor
2393           Intel Celeron processor

C:\> wmic os get Name
Microsoft Windows XP Professional|C:\WINDOWS|\Device\Harddisk0\Partition1

更多例子:

http://people.virginia.edu/~rtg2t/winadmin/wmic.html

http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/using_wmic.mspx?mfr=true

http://blog.commandlinekungfu.com/2009/09/episode-61-just-sit-right-back-youll.html