Yes. It's called SetEnvironmentVariable:

http://msdn.microsoft.com/en-us/library/ms686206(v=vs.85).aspx">http://msdn.microsoft.com/en-us/library/ms686206(v=vs.85).aspx