我想使用wmic创建一个批处理文件。
WMIC应自动阅读我的COMPUTERNAME
WMIC单行命令是:
wmic /output:c:\COMPUTERNAME_os.list os get /format:list
wmic /output:c:\COMPUTERNAME_sw_installati.list product get /format:list
wmic /output:c:\COMPUTERNAME_av.list /NAMESPACE:\\root\SecurityCenter2 PATH AntiVirusProduct GET /value /format:list
wmic process list full > c:\COMPUTERNAME_process.list
tasklist /svc > c:\COMPUTERNAME_servizio.list
systeminfo > c:\COMPUTERNAME_sysinfo.list
如果有人可以帮助我,我将不胜感激。
谢谢
安东尼奥
答案 0 :(得分:1)
%COMPUTERNAME%
。C:\
似乎不是一个好主意(在下面的示例中,我使用%temp%
代替。)您的脚本将是包含.bat
或.cmd
扩展名的纯文本文件(例如记事本):
@echo OFF
wmic /output:"%temp%\%COMPUTERNAME%_os.list" os get /format:list
wmic /output:"%temp%\%COMPUTERNAME%_sw_installati.list" product get /format:list
wmic /output:"%temp%\%COMPUTERNAME%_av.list" /NAMESPACE:\\root\SecurityCenter2 PATH AntiVirusProduct GET /value /format:list
> "%temp%\%COMPUTERNAME%_process.list" wmic process list full
> "%temp%\%COMPUTERNAME%_servizio.list"tasklist /svc
> "%temp%\%COMPUTERNAME%_sysinfo.list" systeminfo