so i need to delete registry keys but it doesn't need to be done through system commands. if i do that it says that it's been blocked by an admin. is there a way to delete the "HKLM\software\policy" key with strictly c++ and not bringing in system commands with the system () option?
It doesn't matter how the registry is accessed, whether by a program or directly in regedit, the actions are constrained by the permissions of the user account.
Programs that use an installer, ask the installer to do stuff. As the installer runs with Administrator privileges, changes are made that way.
If it's your machine, you ought to be able to grant your account sufficient privileges to do what you want. But remember, all programs run under your account will run with these elevated privileges.