| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Registry question
hi there!
i'm just wondering is it possible to write a function in C that will create a System Variable with its corresponding value (without causing for a system restart)? regards, jaro |
|
#2
|
||||
|
||||
|
That function already exists...
try typing 'SET' or 'SET /?' in a cmd prompt To summarise: type 'SET variable=value' will set system variable 'variable' to value 'value'. You can do this from C with the 'system()' function.
__________________
This is my code. Is it not nifty? "The biggest problem encountered while trying to design a system that was completely foolproof, was, that people tended to underestimate the ingenuity of complete fools." ---Douglas Adams Join the Itsacon fanclub! Zero Tolerance: Spammers banned so far: 280
![]() |
|
#3
|
|||
|
|||
|
thanks Itsacon,
I did try what you said, but when i try to check the system variable that i've made (using the cmd window) i did'nt see it. i've check it using the Computer icon. sorry for my english regards, jaro |
|
#4
|
||||
|
||||
|
An environment variable is not the same as a system variable. Usually (I used these more on *nix machines than windows) environment variables only live as long as *drumroll* your process(/shell) environment.. On linux you can EXPORT (bash) your env variable, although after a reboot they will be gone again. Am not sure how to do it on windows, sorry.
I believe SET just sets an environment variable. |
|
#5
|
|||
|
|||
|
Quote:
If you are using the environment of VC++, then in Visual Studio there are many funcitions starting with WriteRegKeyXXXX for changing registry values. In Visual Studio environment you can use C code to affect registry variables without restarting. For Kernal Level variables it is however important to reboot your system as changes won't be seen unless restarted. |
|
#6
|
|||
|
|||
|
thanks Itsacon and Cirus.
it help me make sense on what I'm currently working on.. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > C/C++ Help > Registry question |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|