I am trying to set the PATH environment variable in windows 7 using a bat-file; however it does not seem to work.
I am using this windows command:
se
To do this properly I think you really need to go beyond a simple batch file. The MSDN documentation states:
To programmatically add or modify system environment variables, add them to the HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment registry key, then broadcast a WM_SETTINGCHANGE message with lParam set to the string "Environment". This allows applications, such as the shell, to pick up your updates.
First of all you won't be able to write to that key without a UAC elevation prompt. That's best arranged by adding the appropriate manifest to an executable file. Secondly, broadcasting WM_SETTINGCHANGE isn't simple from a batch file.
In your position I'd write a short and simple console app to do the job.