wmic error (invalid XSL format) in windows7

匿名 (未验证) 提交于 2019-12-03 09:05:37

问题:

wmic process get /format:csv 

What is wrong with this command in Windows 7?

I get:

Invalid XSL format (or) file name.

回答1:

It's a bug in the wmic command. It's been suggested to copy XSL files into the %WINDIR%\system32 (or equivalent if 64 bit.) However, the command below works just as well without the need to copy files:

wmic process get ProcessId,Description,CommandLine,ExecutablePath,ParentProcessId /format:"%WINDIR%\System32\wbem\en-us\csv"

Of course, the "en-us" will be different for different locales.

If you want to redirect output to a file add a switch /output:"your filename here" before the process keyword



回答2:

This is a bug in Windows 7 WMIC. When you use (for example) Dutch regional settings in an English Windows installation, WMIC searches for the xsl files inside C:\Windows\System32\wbem\nl-NL, instead of C:\Windows\System32\wbem\en-US where they are.

Workarounds:

  1. Copy or move the C:\Windows\system32\wbem\en-US\*.xsl files up into the C:\Windows\system32\wbem\ folder.
  2. Change your regional settings to match your Windows language version, log out and back in.
  3. Specify the full path: WMIC process get /format:"%WINDIR%\System32\wbem\en-US\csv".


回答3:

This is a Windows 7 wmic bug. Change the International setings to English (United States), reboot and test.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!