summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/utils/net_registry.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source3/utils/net_registry.c b/source3/utils/net_registry.c
index 7ad0f36823..1e87e809fb 100644
--- a/source3/utils/net_registry.c
+++ b/source3/utils/net_registry.c
@@ -277,7 +277,9 @@ static int net_registry_deletekey_internal(struct net_context *c, int argc,
} else {
werr = reg_deletekey(hivekey, subkeyname);
}
- if (!W_ERROR_IS_OK(werr)) {
+ if (!W_ERROR_IS_OK(werr) &&
+ !(c->opt_force && W_ERROR_EQUAL(werr, WERR_BADFILE)))
+ {
d_fprintf(stderr, "reg_deletekey %s: %s\n", _("failed"),
win_errstr(werr));
goto done;