public virtual void Remove() { try { wmisession.RemoveValue(name); writefail = false; status = ManagementStatus.NoError; } catch (ManagementException me) { status = me.ErrorCode; if (me.ErrorCode == ManagementStatus.AccessDenied) { if (!writefail) { wmisession.Log("Remove failed: " + name + " Access Denied"); writefail = true; } } else { wmisession.Log("Remove failed: " + name + " " + me.ErrorCode.ToString()); throw; } } catch { status = ManagementStatus.Failed; wmisession.Log("Remove failed: " + name); throw; } }