Expand Minimize

DeleteProfile function

Deletes the user profile and all user-related settings from the specified computer. The caller must have administrative privileges to delete a user's profile.

Syntax


BOOL WINAPI DeleteProfile(
  _In_      LPCTSTR lpSidString,
  _In_opt_  LPCTSTR lpProfilePath,
  _In_opt_  LPCTSTR lpComputerName
);

Parameters

lpSidString [in]

Type: LPCTSTR

Pointer to a string that specifies the user SID.

lpProfilePath [in, optional]

Type: LPCTSTR

Pointer to a string that specifies the profile path. If this parameter is NULL, the function obtains the path from the registry.

lpComputerName [in, optional]

Type: LPCTSTR

Pointer to a string that specifies the name of the computer from which the profile is to be deleted. If this parameter is NULL, the local computer name is used.

Note  As of Windows Vista, this parameter must be NULL. If it is not, this function fails with the error code ERROR_INVALID_PARAMETER.

Return value

Type: BOOL

TRUE if successful; otherwise, FALSE. To get extended error information, call GetLastError.

Remarks

DeleteProfile might fail when passed the security identifier (SID) of the local system account (S-1-5-18). For more information, see KB890212.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Userenv.h

Library

Userenv.lib

DLL

Userenv.dll

Unicode and ANSI names

DeleteProfileW (Unicode) and DeleteProfileA (ANSI)

See also

User Profiles Overview
User Profiles Reference

 

 

Community Additions

ADD
Show:
© 2014 Microsoft