【发布时间】:2015-08-17 23:11:23
【问题描述】:
我正在尝试使用 .bat 通过 WMIC 获取系统信息。我想在 C:\ 中使用计算机名称创建一个文件夹,然后在该文件夹中创建一些带有我正在寻找的信息的 .txt 文件。这是我目前所拥有的:
start cmd
cd C:\
md C:\%computername%_Software_Baseline
wmic
/output:C:\%computername%_Software_Baseline\Installed_Software.txt product get name,version
这是我的第一个障碍。我收到文件名无效的消息。接下来的几个是我想在那个文件夹中创建的其他 .txt 文件(一旦我可以做第一个,我应该也可以将它应用到这些文件中)。
/output:C:\%computername%_Software_Baseline\Computer_System_Information.txt computersystem get domain,manufacturer,model,name,totalphysicalmemory
/output:C:\%computername%_Software_Baseline\Disk_Drive_Information.txt diskdrive get model,size,manufacturer
/output:C:\%computername%_Software_Baseline\CPU_Information.txt cpu get architecture,currentclockspeed,description,extclock,l2chachesize,manufacturer,name
/output:C:\%computername%_Software_Baseline\BIOS_Information.txt BIOS get serial number,name,smbiosbiosversion,manufacturer
/output:C:\%computername%_Software_Baseline\OS_Information.txt OS get name,cdsversion,manufacturer,freephysicalmemory,buildnumber
我还希望这也能将所有内容保存到我的网络上的一个文件夹中,但这可以等到我开始执行脚本。
【问题讨论】:
标签: batch-file cmd wmic