Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to set variables by user in login script

Status
Not open for further replies.

alexs0628

MIS
Mar 25, 2002
82
US
I'm trying to create a login batch file where I can set variables based on a user's login name. I tried using
set username="%login_name"
if login_name="(name here)" set console="(console number)"

But this command, which works in novell, does not seem to work on the Windows 2000 server.

What's the correct syntax to do this?


















 
Um, what exactly are you trying to do? Surely you can simply group user for permissions and/or pop certian users in a OU and whack a Group Policy on it? Steve Hewitt
Systems Manager
 
I'm trying to create a logon script under Group Policy for the Domain. I need to set a console variable by user name for the production control software that we use. Right now, in Novell, the login script has these lines in it:

set log_name'"%login_name"
if login_name="alexs" set console="101"

and so forth for every user of the program. But I don't know the syntax to replicate these commands in the Windows 2000 logon file. I'm just trying to write a simple batch file to test the program, which is dos based. But, without the console environment being set, the program won't run.
 
Hmm. What is the "Console"? Did you say its a DOS based app? Can you not set it individually by the user logon script in Active Directory? I know that the NT username variable is %username%.
What exactly is the console? Is it a .bat file or .exe or something? Steve Hewitt
Systems Manager
 
It's an environment variable that you can assign to a computer which then ties into the features of the program. Each user is assigned a console number that relates to their password and features they are allowed to view in the program. For example, go to a command prompt of any computer, type in 'set console=300, then type in 'set' at the next prompt, and you will see console=300 as one of the variables for the PC's settings.

I tried using:

Set %username%="%login_name"
If login_name="alexs" set console=101

Did not work.

I tried:

%username%="alexs" set console=101

Did not work.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top