共用方式為


Managing Defect Log Files

You never have to delete a PREfast for Drivers Defect Log. When you run PREfast for Drivers, it automatically writes the Defect Log to the default location, %APPDATA%\Microsoft\PFD.

If you are using OACR, explicit management should be unnecessary. OACR uses a different location, and manages them on a per-source-file basis.

For Windows Vista, the %APPDATA% variable becomes <drive>:\Users\<user>\Application Data.

For Windows XP or Windows Server 2003 the %APPDATA% variable becomes <drive>:\Documents and Settings\<user>\Application Data.

If a Defect Log with that name already exists in that location, PREfast for Drivers overwrites it without warning.

You might elect to delete PREfast for Drivers Defect Logs that have an alternate file name or location because PREfast for Drivers does not overwrite them. However, the presence of these logs does not affect the operation of PREfast for Drivers.

Saving a Defect Log

To save a Defect Log, create the log with a different name or in a different location. To do so, use the /log parameter of the PREfast Build command. For example, the following command creates a Defect Log named Test.xml in the local directory.

prefast /log=test.xml cl /c test.c

If the log file is already created, rename it or move it to a different location to prevent it from being accidentally overwritten.

Managing Log Files with Alternate Names

If the Defect Log has a name other than Defects.xml or is in a location other than the %APPDATA%\Microsoft\PFD directory, remember to use the /log parameter in any PREfast View, PREfast List, or PREfast Reset command. For example, the following command displays the Test.xml Defect Log:

prefast /log=test.xml view

If you omit the /log parameter, PREfast for Drivers assumes the default name and location for the Defect Log and opens a blank Defect Log if none exists in the default location.

Deleting a Defect Log

To delete a PREfast for Drivers Defect Log, you can delete it manually, such as by deleting the icon for the file in Windows Explorer, typing del at the command line, or by using the PREfast Reset command. For example, the following command deletes the Test.xml Defect Log:

prefast /log=test.xml reset

 

 

Send comments about this topic to Microsoft

Build date: 5/3/2011