我有一个登录脚本,它记录几条信息并针对每个设备执行此操作,然后将其通过管道传输到文件名为 Computer-Name-report.txt 的 txt 中
该公司有数百台设备加入到域中,随后受到此登录脚本的影响,有没有简单的方法将文件夹中的所有 txt 文件导出为 csv 或 xlsx?
这是我用来获取详细信息的批处理脚本:
wmic Computersystem get username > "ENTER-FOLDER-LOCATION-HERE\%computername%-report.txt"
wmic computersystem get name >> "ENTER-FOLDER-LOCATION-HERE\%computername%-report.txt"
wmic os get Name >> "ENTER-FOLDER-LOCATION-HERE\%computername%-report.txt"
wmic bios get serialnumber >> "ENTER-FOLDER-LOCATION-HERE\%computername%-report.txt"
wmic computersystem get model >> "ENTER-FOLDER-LOCATION-HERE\%computername%-report.txt"
wmic os get installdate >> "ENTER-FOLDER-LOCATION-HERE\%computername%-report.txt"
wmic cpu get Name >> "ENTER-FOLDER-LOCATION-HERE\%computername%-report.txt"
wmic memorychip get capacity >> "ENTER-FOLDER-LOCATION-HERE\%computername%-report.txt"
它的输出如下:
UserName
MY_DOMAIN\Joe.Bloggs
Name
Lap-001
Name
Microsoft Windows 10 Professional|C:\WINDOWS|\Device\Harddisk0\Partition2
SerialNumber
CP2978763476223
Model
HP ProDesk 820
InstallDate
20160101010000.000000+060
Name
Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz
Capacity
4294967296
4294967296
4294967296
4294967296
将所有这些内容导入到合适的表格标题下是否可行?