Environment Variable Modification with Scripts
Submitted by Aaron Longwell on Sun, 2005-07-10 08:13.
I recently found an article on ASPN that demonstrates using Python to modify Environment Variables, especially the PATH variable.
The key to the article is that it demonstrates a way to make Environment Variable changes persistent. It does this by modifying the registry directly. After editing the registry, it causes a broadcast to be sent indicating the change in system settings. Although the example is in Python, this process is possible with any language that can access the Win32 system API.
win32gui.SendMessage(win32con.HWND_BROADCAST, win32con.WM_SETTINGCHANGE, 0, 'Environment')

Post new comment