Hey there.

You need to use Interop to access the SetEnvironmentVariable Method in kernel32.dll.  See the following.

See Knowledge Base Article # 829145

Have a nice day!