How do you
set the variable? By changing the registry content? By using the COM interfaces
of WSH?
Did you try
to open an other CMD.EXE (process) after setting the variable? This could be the
issue.
Try with
Sample 2.26 to 2.30 - WMIEnv.wsf,vol 2, at http://www.lissware.net.
This one sets
the env variable with WMI. Choose the name, the value and the env. type. It
should work in a logon script but I suspect that the current process doesn't get
the env. refreshed.
C:\>WMIEnv.wsf
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
Environment variable with its value is missing.
Usage: WMIEnv.wsf [EnvVariable] /Env:value /Action:value [/Force[+|-]]
[/Machine:value] [/User:value] [/Password:value]
Options:
EnvVariable : The environment variable name with its
value.
Env : Specify the environment type: [system] for the system, [user] for the current user, [Domain\UserAccount] for any other user account.
Action : Specify the operation to perform: [list] or [create] or [update] or [delete].
Force : Force a creation if the update fails, force an update if the creation fails.
Machine : Determine the WMI system to connect to. (default=LocalHost)
User : Determine the UserID to perform the remote connection. (default=none)
Password : Determine the password to perform the remote connection. (default=none)
Example:
Env : Specify the environment type: [system] for the system, [user] for the current user, [Domain\UserAccount] for any other user account.
Action : Specify the operation to perform: [list] or [create] or [update] or [delete].
Force : Force a creation if the update fails, force an update if the creation fails.
Machine : Determine the WMI system to connect to. (default=LocalHost)
User : Determine the UserID to perform the remote connection. (default=none)
Password : Determine the password to perform the remote connection. (default=none)
Example:
WMIEnv.wsf
/Action:List
WMIEnv.wsf MyVariable=MyValue /Env:MYXPDOMAIN\Alain.Lissoir /Action:Create
WMIEnv.wsf MyOtherVariable=MyValue /Env:SYSTEM /Action:Create
WMIEnv.wsf MyOtherVariable /Env:SYSTEM /Action:Delete
WMIEnv.wsf MyVariable=MyValue /Env:MYXPDOMAIN\Alain.Lissoir /Action:Create
WMIEnv.wsf MyOtherVariable=MyValue /Env:SYSTEM /Action:Create
WMIEnv.wsf MyOtherVariable /Env:SYSTEM /Action:Delete
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tom Kern
Sent: Thursday, December 08, 2005 1:27 PM
To: activedirectory
Subject: [ActiveDir] envoirment variables
I have a logon script via a user gpo that sets enviorment variables.
However those variables are never set.
Gpresult claims the gpo was processed and i have nothing in my event
logs.
The script was set to run synchronously. Is that the issue.
are the variables not there to set yet?
thanks
