wmic error (invalid XSL format) in windows7

user1264880 picture user1264880 · Mar 12, 2012 · Viewed 19.9k times · Source
wmic process get /format:csv

What is wrong with this command in Windows 7?

I get:

Invalid XSL format (or) file name.

Answer

greenhart picture greenhart · Aug 17, 2013

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