As for how to set the variable, look at setx. It is a reskit tool I believe though I guess it could have been moved into the support tools at some point.
 
As for the mechanism, you have multiple paths you could go down, the path I think I would choose would be a script that is fired for every logon and checks to see if the variable is set, if not, it asks for it and sets it. That way it definitely should get run.
 
  joe


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dan DeStefano
Sent: Tuesday, June 28, 2005 1:36 PM
To: [email protected]
Subject: [ActiveDir] Automate Adding Environment Variables

Is there a way to have a user specify an environment variable at first logon? We have a program that needs to send mail to an e-mail address and this has to be specific to each user. This server (a terminal server) will likely contain 200+ user accounts and doing this manually would be undesirable.

Ideally, I would like it if the first time a user logs onto the server, they are prompted to enter their e-mail address and hit enter, and this will set a user variable that points to this e-mail address (something like
[EMAIL PROTECTED]. I was thinking it would be best if this can be done with a simple DOS batch file that can be set to run at first user logon, probably by adding it to the "Runonce" key in the user's registry hive (unless there is a better way). We do not want this to execute every time the user logs onto the terminal server.

I would greatly appreciate any help,


Dan DeStefano

Reply via email to