Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer


This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

Deletes a profile.

HRESULT DeleteProfile(
  LPTSTR lpszProfileName,
  ULONG ulFlags


[in] A pointer to the name of the profile to be deleted.


[in] Always NULL.


The profile was successfully deleted.


The specified profile does not exist.

The IProfAdmin::DeleteProfile method deletes a profile. If the profile to delete is in use when DeleteProfile is called, DeleteProfile returns S_OK but does not delete the profile immediately. Instead, DeleteProfile marks the profile for deletion and deletes it after it is no longer being used, when all of its active sessions have ended.

The entry point function for each message service in the profile is called with the MSG_SERVICE_DELETE value set in the ulContext parameter. First, the function deletes the service, and then it deletes the service's profile section. The message service entry point function is not called again after the service has been deleted.

No password is required to delete a profile.

For MFCMAPI sample code, see the following table.






MFCMAPI uses the IProfAdmin::DeleteProfile method to delete the selected profile.

© 2016 Microsoft