Houman
Sat Jan 17 10:34:13 CST 2004
Ignore may last...
The GPO was on the computer OU ( since it's a TS ), with the GPO Loopback
enabled...
It took a reboot of the server ( or probably a GPUpdate would have done it
also, but there are test servers, so why the not.. ) for it to work ...
Thanks very very much !!!
--
--
Houman Yahyaei ( CCNA, MCSE Win 2000/NT 4.0, MCT )
IT Training and Consulting
"Houman Yahyaei" <news@formationhy.com> wrote in message
news:uY0BcPR3DHA.1816@TK2MSFTNGP12.phx.gbl...
> Thanks for the reply, I have done the first example, but still the same
> thing...
>
> If I run the command : "%windir%\System32\RUNDLL32.EXE
> user32.dll,UpdatePerUserSystemParameters" from the command prompt, I can
see
> my desktop icon refreshing, but the environment variables still not
> loaded...
>
> So I was wondering what else I could do, I also have configured the GPO
that
> is running this script to "Run Logon scripts Synchronously" and to "always
> wait for the network at computer start-up and logon"...
>
> I haven't tried your command on a WinxP box, but rather this is for a
Win2K3
> Terminal server, so I tried it in a user's TS session...
>
> Thanks for all your help !!!!
>
> --
> --
> Houman Yahyaei ( CCNA, MCSE Win 2000/NT 4.0, MCT )
> IT Training and Consulting
>
>
> "Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> wrote in message
> news:40087795.3FC69BC0@hydro.com...
> > Houman Yahyaei wrote:
> >
> > > Hi, I have a script that set environment variables in the following
way
> :
> > >
> > > Set WshEnv = WshShell.Environment("USER")
> > >
> > > WshEnv("Appvar1") = xyz
> > >
> > > This works ok, and when going to the User's Environment variables
> section on
> > > the computer, all the custom variables are there, but the problem is
> they
> > > don't seem to be already loaded into memory or the value doesn't seems
> to be
> > > loaded by the OS...
> >
> > Hi
> >
> > (a side note first: the groups scripting.debugger, scripting.remote and
> > scripting.scriptlets are not relevant to you question really)
> >
> > That is not how I experience it (Win2k and WinXP). After the script
above
> is
> > finished, if I open a new command prompt and type set, I see the Appvar1
> > variable.
> >
> > Try this and see if this works for you:
> >
> > Set oShell = CreateObject("WScript.Shell")
> > Set oUserEnv = oShell.Environment("USER")
> > xyz = "abcxyz"
> > oUserEnv("Appvar1") = xyz
> >
> > oShell.Run _
> > "%windir%\System32\RUNDLL32.EXE
> user32.dll,UpdatePerUserSystemParameters", _
> > 1, True
> >
> >
> > Note that if this newly created environment variable is to be available
> for the
> > script itself (or any child processes it starts), you will need to set
it
> in the
> > process environment as well, as this script demonstrates:
> >
> >
> > Set oShell = CreateObject("WScript.Shell")
> > Set oUserEnv = oShell.Environment("USER")
> > Set oProcessEnv = oShell.Environment("PROCESS")
> >
> > xyz = "123abcxyz789"
> > oUserEnv("Appvar1") = xyz
> > oProcessEnv("Appvar1") = xyz
> >
> > oShell.Run "%comspec% /k set", 1, False
> >
> >
> > --
> > torgeir
> > Microsoft MVP Scripting and WMI, Porsgrunn Norway
> > Administration scripting examples and an ONLINE version of the 1328 page
> > Scripting Guide:
http://www.microsoft.com/technet/scriptcenter
> >
> >
>
>