Skip to content

Latest commit

 

History

History
105 lines (74 loc) · 3.41 KB

nf-userenv-deleteprofilea.md

File metadata and controls

105 lines (74 loc) · 3.41 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:userenv.DeleteProfileA
DeleteProfileA function (userenv.h)
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. (ANSI)
DeleteProfileA
userenv/DeleteProfileA
shell\DeleteProfile.htm
shell
48a08d9a-4fdc-43ab-8323-c49bc2d0a58d
12/05/2018
DeleteProfile, DeleteProfile function [Windows Shell], DeleteProfileA, DeleteProfileW, _shell_DeleteProfile, shell.DeleteProfile, userenv/DeleteProfile, userenv/DeleteProfileA, userenv/DeleteProfileW
userenv.h
Windows
Windows 2000 Professional [desktop apps only]
Windows 2000 Server [desktop apps only]
DeleteProfileW (Unicode) and DeleteProfileA (ANSI)
Userenv.lib
Userenv.dll
Windows
19H1
DeleteProfileA
userenv/DeleteProfileA
c++
APIRef
kbSyntax
DllExport
Userenv.dll
DeleteProfile
DeleteProfileA
DeleteProfileW

DeleteProfileA function

-description

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.

-parameters

-param lpSidString [in]

Type: LPCTSTR

Pointer to a string that specifies the user SID.

-param 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.

-param 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.
 

-returns

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).

Note

The userenv.h header defines DeleteProfile as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

-see-also

User Profiles Overview

User Profiles Reference