You cant really. You have to scan for rootkits and such. Also it is possible that it is a permissions problem in the registry, which my Windows Repair tool can fix if that is the case.
Those commands do read and write to the registry, so an access denied error could be from it not having access to something in the registry.
Shane