系统信息批量?

时间:2014-02-12 03:43:23

标签: html batch-file cmd html-table operating-system

批处理中是否有任何方法可以将以下信息输出到带有表的HTML文件中,或者如果文本文档不可能?

  • OS
  • 计算机名称(网络)
  • 内存量
  • CPU速度
  • 目前已登录用户
  • 任何建议?

如果其中一些是不可能的,那很好,但我知道大多数是,因为我的学校有一个像这样的批处理文件,对于帮助台,但他们将它转换为exe,所以我无法查看代码。 (有一个漂亮的HTML表格的输出。如果有人可以提供帮助,我们将非常感激。

2 个答案:

答案 0 :(得分:0)

下面的代码将为您提供系统的完整信息(删除引号):

    : FULL SYSTEM INFO    
    : START CMD    

    : Set the dialog title    
    title FULL SYSTEM INFO    

    @echo off    

    : Display nothing but add whitespace    
     echo.

    : Displaying text    
    echo Exporting System Info...

    : Using the SYSTEMINFO command and export it directly into a text file    
    SYSTEMINFO>INFO.txt

    : Display nothing but add whitespace    
    echo.

    : Displaying text    
    echo INFO.txt Exported!

    : Open the newly exported file in notepad    
    notepad.exe INFO.txt    

    : Wait on user    
    pause    

    : STOP CMD

答案 1 :(得分:0)

你可以尝试这一行代码,它应该告诉你你需要的每一件事:

systeminfo | findstr /B /C:"OS Name" /C:"OS Version" /C:"OS Manufacturer" /C:"OS Configuration" /C:"OS Build Type" /C:"Original Install Date" /C:"System Boot Time" /C:"System Manufacturer" /C:"System Model" /C:"System Type" /C:"Processor(s)" /C:"BIOS Version" /C:"Windows Directory" /C:"System Directory" /C:"Boot Device" /C:"System Locale" /C:"Input Locale" /C:"Total Physical Memory" /C:"Available Physical Memory" /C:"Virtual Memory: Max Size" /C:"Virtual Memory: Available" /C:"Virtual Memory: In Use" /C:"Domain" /C:"Network Card(s)"

要查看输出,您还需要暂停,为了更整洁,您需要关闭@echo,所以它会是这样的:

@echo off
systeminfo | findstr /B /C:"OS Name" /C:"OS Version" /C:"OS Manufacturer" /C:"OS Configuration" /C:"OS Build Type" /C:"Original Install Date" /C:"System Boot Time" /C:"System Manufacturer" /C:"System Model" /C:"System Type" /C:"Processor(s)" /C:"BIOS Version" /C:"Windows Directory" /C:"System Directory" /C:"Boot Device" /C:"System Locale" /C:"Input Locale" /C:"Total Physical Memory" /C:"Available Physical Memory" /C:"Virtual Memory: Max Size" /C:"Virtual Memory: Available" /C:"Virtual Memory: In Use" /C:"Domain" /C:"Network Card(s)"
pause
相关问题