The issue is that win32 api can't handle names with embedded null characters. That's certainly an issue when it comes to registry keys, because such keys are not deletable by OS shipped registry tools. Here's the more complete description; http://reboot.pro/files/file/232-regkeyfixer/ Code for PoC to create invalid keys are attached as CreateInvalidKey.au3 Code for the tool to fix these keys are attached as RegKeyFixer.au3 Option for recursive search is on the todo list. CreateInvalidKey.au3 RegKeyFixer.au3