Being A Cheapskate With Code Is That Ok For Awhile?

So I recently got some wonderful assistance with using the RegSetEx(

RegOpenEx etc. functions used for windows for controlling and changes values in the registry. They work, but they are a little complicated with all kinds of arguments within the function and you have to use a tchar string literal as one of the arguments, you must specify the reg type like REG_SZ etc. etc.


What about Mr. Easy Cheapskate Street? What about just using the system call functions like

system("reg add etc. etc".);



I know it's cheapskatey but it works you know? If you get the same result with less code why not? Now I'm trying to learn C++ thoroughly so I went all out and learned the function. I'm still just a beginning but is their any technical utilitarian advantage to using the function vs the simple system command to change a registry key for instance?

Both tell the computer to do the same thing right?


I'm just guessing here, but I suppose it goes like this:

system("Whatever"), besides highly unrecommended, opens a terminal and calls an app.

RegSetEx is a function that manipulates registry directly, no more apps called.
Last edited on
I never use system calls for anything. even though im pretty sure registry calls are microsoft specific i still wouldnt use system command. I dont know the ins and outs of the system command but im wondering if you could run into administrator problems with win 7 and using that.
I never use system calls for anything. even though im pretty sure registry calls are microsoft specific i still wouldnt use system command. I dont know the ins and outs of the system command but im wondering if you could run into administrator problems with win 7 and using that.


Good question, I've been tinkering with it just because I'm a curious George and also because I hate things I don't understand....which might be why I get mad at c++ sometimes lol.

In any case simple things thus far work like copying files deleting them etc. etc. on my windows 7 box just using the system command. It would normally work doing basic tasks on most machines but it adds one more thing to your code that could potentially NOT WORK on some machines..

I'm assuming if the command prompt is disabled for instance? Might not work at all?
To save time learning the undoubtedly horrible (assuming based on my experience with ReportEventA) RegSetEx, I could quite well go with the system approach.

My only real argument against it, would be that if I am setting registry entries, I am also probably reading them, and if I'm doing that I'll have to learn the API anyway.

Topic archived. No new replies allowed.