windows server 2008 r2 environmental variables

iamaidiot
iamaidiot used Ask the Experts™
on
Hello,

We have a terminal server that employess logins to use one specific software.  The software requires each individual user to have their own environmental variable value (the actual variable will be the same).  I don't want to have to do it on each individual username manually.  I know i can create a batch file and set environamental variable via setx.  My question is, how would i get setx to set  same variable but different value for each individual user via cmd/batch.  This way I can just add it to gpo and have it run when they login
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
When you say a different value, is it a specific value the software requires or does it simply need to be different from User A to B to C?
Lee W, MVPTechnology and Business Process Advisor
Most Valuable Expert 2013

Commented:
How does it have to be different? Is it a sequence of numbers?  Or could it just be another name for %username%?

One thought, batch script with a list of the variables and users in a text file.  You can open the text file, find the user name and set the variable to the value next to the user name.

Author

Commented:
Hey Willian/Lee

variable name will be the same, the variable value can be anything random preferebly combination of lettersandnumbers as long as it is unite from user A to B to C.

Variable Name SSI_BASE (always the same)
Variable Value  abcd1234 (needs to be unique for each user, but can be random combination of letter/number)
Technology and Business Process Advisor
Most Valuable Expert 2013
Commented:
So why not just make it the username?  SET SSI_BASE=%username% - it will always be unique to the user.

Author

Commented:
Hey Lee,

Thank you that is what I went with, I also added milliseconds in front just to make sure it will be even more unique like this  setx SSI_Base %time:~-2%%username%.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial