Hundred of warnings like this: `WARN: While quoting value for
'<registry_key>', warning returned: Data could not be interpreted,
quoting raw buffer.' are outputed when reglookup reads the registry
of a Windows 2012 system.
exit 0
fi
+# Supress a specific reglookup warning messages. In Windows 2012, although the
+# command works correct, it polluts the output with hundreds of warning
+# messages about not being able to interprete registry key values.
+RGLKP_WRNG="^WARN: While quoting value for '.\+', warning returned: Data could not be interpreted, quoting raw buffer."
hive="$SNF_IMAGE_TARGET/Windows/System32/config/SYSTEM"
-current=$($REGLOOKUP "$hive" | grep ^/Select/Current | cut -d, -f3)
+current=$($REGLOOKUP "$hive" 2> >(grep -v "$RGLKP_WRNG" >&2) | grep ^/Select/Current | cut -d, -f3)
# Change the key value.
# For a stupid reason chntpw returns 2!