Microsoft KB Archive/814173

= WMIC output data is not correctly formatted by Excel when you use the /FORMAT:CSV switch =

PSS ID Number: 814173

Article Last Modified on 12/23/2003

-

The information in this article applies to:


 * Microsoft Windows Server 2003, Standard Edition
 * Microsoft Windows Server 2003, Enterprise Edition
 * Microsoft Windows Server 2003, Datacenter Edition

-





SYMPTOMS
When you use the /FORMAT:CSV switch to generate Windows Management Instrumentation Command-line (WMIC) output data, Microsoft Excel does not correctly format the CSV file that is generated by the WMIC utility.



CAUSE
The behavior that is described in the &quot;Symptoms&quot; section is a known issue when you use the WMIC utility to generate a CSV file and to open that file in Excel.



WORKAROUND
To work around this issue, use any one of the following methods, depending on your circumstances.

Method 1: Save the file as an American National Standards Institute (ANSI) file in Notepad
To save the file as an ANSI file in Notepad, follow these steps:
 * 1) Start Windows Explorer.
 * 2) Locate the CSV file.
 * 3) Right-click the CSV file, click Open With, and then click Notepad.
 * 4) Click File, and then click Save As.
 * 5) In the Encoding box, make sure that ANSI is selected, and then click Save.

Method 2: Add a command to redirect the output
If the file is generated in a batch routine, add a command to redirect the output. If you redirect output to the console, the encoding is converted to ANSI. To do this, add the following command to the batch command file after the CSV file is generated:

Type .csv > .csv

Method 3: Edit %Windir%\system32\wbem\csv.xsl to change the output encoding to ANSI
Edit the %Windir%\system32\wbem\csv.xsl file to change the output encoding to ANSI. To do this, follow these steps:  Start Windows Explorer, and then locate the %Windir%\system32\wbem folder. In the right pane, click Csv.xsl, click File, and then click Edit. In the following line

xsl:output encoding=&quot;UTF-16&quot; omit-xml-declaration =&quot;yes&quot;/

change &quot;UTF-16&quot; to US .

Additional query words: CSV FORMAT

Keywords: kbprb KB814173

Technology: kbWinServ2003Data kbWinServ2003DataSearch kbWinServ2003Ent kbWinServ2003EntSearch kbWinServ2003Search kbWinServ2003St

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© 2004 Microsoft Corporation. All rights reserved.