有没有办法使用WQL
查询计算Windows进程可执行文件的文件大小?
我尝试了下面的内容,但Powershell给了我一个管理例外。
SELECT Caption, ExecutablePath, CommandLine From Win32_Process, (SELECT FileSize FROM Cim_DataFile WHERE Win32_Process.ExecutablePath = Cim_DataFile.Name) as ExecutableSize WHERE ExecutablePath != ''
Powershell的输出
Get-WmiObject:无效查询在行:1 char:14 + Get-WmiObject<<<< -Query" SELECT Caption,ExecutablePath,CommandLine来自Win32_Process,(SELECT FileSize FROM Cim _DataFile WHERE Win32_Process.ExecutablePath = Cim_DataFile.Name)as ExecutableSize WHERE ExecutablePath!=''" + CategoryInfo:InvalidOperation:(:) [Get-WmiObject],ManagementException + FullyQualifiedErrorId:GetWMIManagementException,Microsoft.PowerShell.Commands.GetWmiObjectCommand
有人可以建议吗?