After doing some testing I think I found the reason why it didnt reset. The command is put into the RunOnce registry key. So anything that logs in next it will run and remove it self. But if something on the system logs in, such as nvidias update user account they create, then it gets ran, doesnt have permission and is removed the registry.
And there you have the same boat you where in.
So I am going to change the program to mark in the settings.ini file if it changed the system into safe mode. Then next time the program is ran it will check if it is in safe mode and if it is it will then run the command to take safe mode off. I wont rely on the registry key any more since it isnt reliable
Shane