Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Setting an Env. variable during start-up

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,48277
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Setting an Env. variable during start-up
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Setting an Env. variable during start-up - 6/14/2007 12:41:54 AM   
  J.Ennenga

 

Posts: 3
Score: 0
Joined: 4/17/2007
Status: offline
Hey guys,

I have the following problem,
I want to set a system variable that is immediatly available to be used bij the GPO that follows after the login script.
The variable will be used to map the My Documents folder to a specific drive (depending on the first number of the username) the mapping looks like this:
\\DC1\%SU%$\%USERNAME%
The script below is executed before the GPO's are applied and after the first logon I can see that the variable has been set correctly.

The problem is that the GPO cannot use this variable at the first logon attempt, it's only after the second logon that this variable becomes available to the GPO and the mapping succeeds.

I've made the following VB script:


      

Any suggestions will be highly appreciated!

Jelle
 
 
Post #: 1
 
 RE: Setting an Env. variable during start-up - 6/14/2007 1:42:37 AM   
  ebgreen


Posts: 5250
Score: 31
Joined: 7/12/2005
Status: offline
Environment variables are tied to the session that a process is operating in. So even if the GPO update happens later, if the session that executes it is already running before the env change then the GPO will not se it.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to J.Ennenga)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Setting an Env. variable during start-up Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts