The IWamAdmin::AppDelete method deletes a Web application definition from this metabase key, and optionally all of its subkeys. If the application is running, it will be shut down. If the application is in-process with IIS, all out-of-process resources associated with the application will be released if the resources are not referenced by another in-process application.
Note Server component DLLs are not released from in-process applications, even if they aren't currently referenced by other applications.
Deletions performed using IWamAdmin::AppDelete cannot be undone.
HRESULT STDMETHODCALLTYPE AppDelete(
LPCWSTR szMDPath,
BOOL fRecursive
);
The method will return NO_ERROR if the method succeeded, even if no application was defined at the specified path. If the method fails, other error codes converted to an HRESULT will be returned.