Logon script multiple users

Score
0
Vote Up
January 30, 2012 at 06:06:23 Pacific
Specs: Windows 7

Hi!

We are using a simple logon script for example:

if /i %USERNAME:~4,5%==name1 goto name1

Now we need to re-program this to user multiple users.

For example:
User_Name1
User_Name2
User_Name3
User_Name4
etc. etc.

How can i script this to one line instead of mulitple lines ?

Kind Regards!
Kevin


Reply ↓  Report •


#1
Vote Down
Score
0
Vote Up
January 30, 2012 at 11:07:26 Pacific

Can you post your full script?

Tony


Reply ↓  Report •

#2
Vote Down
Score
0
Vote Up
January 31, 2012 at 04:41:10 Pacific

Hi Tony!

It's a simple script:

if /i %USERNAME:~5,5%==name1 goto name1

:Name1
(Start some programs)

I can solve this by creating different lines of al 50 accounts, like:

if /i %USERNAME:~5,5%==name1 goto name1
if /i %USERNAME:~5,5%==name2 goto name1
if /i %USERNAME:~5,5%==name3 goto name1
if /i %USERNAME:~5,5%==name4 goto name1
if /i %USERNAME:~5,5%==name5 goto name1
etc. etc.

But i think it can be solved by changing some code of the original code :)


Reply ↓  Report •

#3
Vote Down
Score
0
Vote Up
January 31, 2012 at 05:22:00 Pacific

Q: Why even bother in the first place? A logon script will either have general configuration stuff, so the name of the user doesn't matter; or it'll have specific settings for the specific user, in which case it should be tied to the specific account and not in the general logon script.

How To Ask Questions The Smart Way


Reply ↓  Report •

Reply to Message Icon Start New Discussion
Related Posts

« How Can I Dump a Text Fil... Filter Xcopy containing t... »