UserEnvDeleteProfile Method
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.
Namespace: DevCase.Win32.NativeMethodsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("UserEnv.dll", CharSet = CharSet.Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)]
public static bool DeleteProfile(
string userSid,
string profilePath,
string computerName
)
<DllImportAttribute("UserEnv.dll", CharSet := CharSet.Auto, BestFitMapping := false,
ThrowOnUnmappableChar := true, SetLastError := true>]
Public Shared Function DeleteProfile (
userSid As String,
profilePath As String,
computerName As String
) As Boolean
Dim userSid As String
Dim profilePath As String
Dim computerName As String
Dim returnValue As Boolean
returnValue = UserEnv.DeleteProfile(userSid,
profilePath, computerName)
public:
[DllImportAttribute(L"UserEnv.dll", CharSet = CharSet::Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)]
static bool DeleteProfile(
String^ userSid,
String^ profilePath,
String^ computerName
)
[<DllImportAttribute("UserEnv.dll", CharSet = CharSet.Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)>]
static member DeleteProfile :
userSid : string *
profilePath : string *
computerName : string -> bool
No code example is currently available or this language may not be supported.
- userSid String
-
Pointer to the SID of the user as a string.
- profilePath String
-
Pointer to a string that specifies the profile path.
If this parameter is , the function obtains the path from the registry.
- computerName String
-
Pointer to a string that specifies the name of the computer from which the profile is to be deleted.
If this parameter is , the local computer name is used.
Note: As of Windows Vista, this parameter must be .
If it is not, this function fails with the error code E_INVALIDARG.
Boolean
If the function succeeds, the return value is
.
If the function fails, the return value is
.
To get extended error information, call
GetLastWin32Error.