[racket] putenv

From: heraklea at gmx.de (heraklea at gmx.de)
Date: Tue Oct 23 04:58:58 EDT 2012

Ok, now I try it a little bit different. I try to write this code in Racket/scheme:

Set WSHShell = WScript.CreateObject("WScript.Shell")
WSHShell.Environment("SYSTEM").item("var") = "value"

(require ffi/com)
(define WSHShell (com-create-instance "WScript.Shell"))
(define ENV (com-get-property WSHShell "Environment" ))

and here begins the Problem: It seems that I dont know how to give "SYSTEM" parameter to Environment method. Is there a ffi specific syntax that I dont explore yet??

yours,

-------- Original-Nachricht --------
> Datum: Tue, 23 Oct 2012 01:16:06 -0700
> Von: Niklas Larsson <metaniklas at gmail.com>
> An: "heraklea at gmx.de" <heraklea at gmx.de>
> Betreff: RE: [racket] putenv

> The environment is something that belongs to a process (and its
> children). The way to change the system wide defaults on windows (from
> a program) is to change the registry keys that hold them. Remember that
> those only affect new processes.
> 
> Niklas
> From: heraklea at gmx.de
> Sent: 2012-10-23 09:48
> To: racket
> Subject: Re: [racket] putenv
> Hmm, is there a Racket specific command to change env variables system
> wide??
> The (system "...") command also change it only locally....
> 
> Yours,
> -------- Original-Nachricht --------
> > Datum: Mon, 22 Oct 2012 08:02:36 -0600
> > Von: Jay McCarthy <jay.mccarthy at gmail.com>
> > An: heraklea at gmx.de
> > CC: racket <users at racket-lang.org>
> > Betreff: Re: [racket] putenv
> 
> > How are you checking "in the system"?
> >
> > putenv does not make a global change to your system settings, instead
> > it changes the environment locally. For example, on Unix (it would
> > work the same on Windows, but I don't know a lot about the Windows
> > shell),
> >
> > [outer] $ FOO=1
> > [outer] $ echo $FOO
> > 1
> > [outer] $ racket
> > [racket] > (putenv "FOO" "2")
> > #t
> > [racket] > (getenv "FOO")
> > "2"
> > [racket] > (system "/bin/sh")
> > [inner] $ echo $FOO
> > 2
> > [inner] $ exit
> > > (exit 0)
> > [outer] $ echo $FOO
> > 1
> >
> > The only real use of putenv is with system, when you want the Racket
> > program to run another program.
> >
> > Jay
> >
> > On Mon, Oct 22, 2012 at 7:38 AM,  <heraklea at gmx.de> wrote:
> > > Hello friends,
> > >
> > > I try to change my env variables in windows 7. getenv works fine, but
> > when I change a specific env variable it returns #t but in the system
> there
> > are no changes...
> > >
> > >
> > > Yours,
> > > ____________________
> > >   Racket Users list:
> > >   http://lists.racket-lang.org/users
> >
> >
> >
> > --
> > Jay McCarthy <jay at cs.byu.edu>
> > Assistant Professor / Brigham Young University
> > http://faculty.cs.byu.edu/~jay
> >
> > "The glory of God is Intelligence" - D&C 93
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users

Posted on the users mailing list.