[Haskell-cafe] Setting environment variables on Windows

Sönke Hahn shahn at cs.tu-berlin.de
Wed Oct 14 10:14:00 EDT 2009

On Friday 09 October 2009 07:07:21 pm Duncan Coutts wrote:
> On Fri, 2009-10-09 at 17:37 +0200, Sönke Hahn wrote:
> > Hi!
> >
> > I need to set an environment variable from Haskell and i would like to do
> > that cross-platform. There is System.Posix.Env.setEnv, which does
> > exactly, what i want on Linux. There is the module System.Environment,
> > which seems to be cross-platform, but it does not contain functions to
> > manipulate the environment (, just to inspect it). At first glance, I
> > didn't find anything relevant in the sub-modules of System.Win32.
> Note that often it is enough to set environment variables for the
> programs that you invoke, rather than for your own process. If that's
> enough then you can do it via the System.Process.createProcess action.
> Duncan

Thanks for the suggestion. In my case, that would be a workaround. Maybe still 
better than writing a .bat-file for the same purpose.


More information about the Haskell-Cafe mailing list