Solved

Windows NT Login Scripts with Windows95 Client

Posted on 1999-01-28
9
358 Views
Last Modified: 2013-12-23
I have 95 machines running the login script "Login.Bat" from the NT server and need to determine the users "USERNAME" and "HOMEPATH" on that 95 client.  Decisions in the script will be based on this variable.  Any ideas?
0
Comment
Question by:mamorian
9 Comments
 

Expert Comment

by:clafleur
ID: 1572302
You can do hide shared folder with $ for your user on the server (homepath) In User manager for domain, select user, profile and go to the home directory topic.  connect (drive) \\servername\username$

also write logon.bat in logon script name.  The logon.bat need to be in %systemroot%\system32\repl\import\scripts (netlogon share)

In logon.bat you need to write

net use [home dir. drive] /home
net use [drive] \\servername\share /y





You can use some built-in variable :
%COMPUTERNAME% Name of computer
%HOMEDRIVE% Users local drive letter
%HOMEPATH% The full path of the users home area
%HOMESHARE% The share that contains the users home area
%LOGONSERVER% This is the name of the machine that validates the user logon
%OS% The operating the User is connected to
%PROCESSOR% e.g. 486 (useful to put in a login script and ridicule if a 386 or below)
%USERDOMAIN% Domain containing the Users Account
%USERNAME% The name of the user


good luck

0
 
LVL 2

Expert Comment

by:mbreuker
ID: 1572303
The most basic answer that immediately comes to mind is to create a template login script, say login.bat, and each time you add a new user, make the appropriate change to login.bat and save it as username.bat. When creating the new user in User Manager, specify the login script to be username.bat rather than login.bat.

I get the feeling that for one reason or another, it is not that easy for you. I understand. I recently had to implement a login script on a network where everyone uses the same username and I needed to base script decisions on the machine name, which doesn't exist as a variable in Windows 95. My solution, thanks to the help of people here at Expert's Exchange, was to create the variable. Here is one way it can be done. . .

1. Make use of the command "NET CONFIG," which generates the following output:

Computer name                    \\COMPUTER_NAME
User name                           USERNAME
Workgroup                           WORKGROUP
Workstation root directory     C:\WINDOWS

Software version               4.00.950
Redirector version             4.00  
The command was completed successfully.

In the first part of your login script, add the following line

   net config > c:\config.txt

This will create a text file on the local machine which contains the relevant information you need. Next you make use of the "find" command, which will let you extract that information. The problem with the "find" command is that you must search for specific text, so you must use errorlevel checking and search for each possible username. This creates some work when first writing the batch file, but is easy maintenance afterward. Here is an example of using "find" to discover the username, set the environment variable to match, and then acting on that information.

:StartFind

:User1
find /i "User1" c:\config.txt > nul
if errorlevel 1 goto User2
set USERNAME=User1
set HOMEPATH=u:\user1
goto EndFind

:User2
find /i "User2" c:\config.txt > nul
if errorlevel 1 goto User3
set USERNAME=User2
set HOMEPATH=u:\User2
goto EndFind

:User3

 . .

:EndFind

:StartScript
Echo "Hello, you are logged in as" %USERNAME%

If %USERNAME% == User1 Goto Message
Goto EndMessage

:Message
echo "Warning: You're account will expire at the end of them month, please call the HelpDesk."
pause
:EndMessage

:StartBackup
copy c:\data\user.dat %HOMEPATH%
:End Backup

:End



As you can see, I have a lot of freedom within the script once I have the environment variable set to what I need. While the initial steps here are sophisticated and tedious (although not hard really), it can be quite easy to manage after that. Each time you add a new user, just add a new line the script. The execution of the net config command and the subsequest searching for data takes only a fraction of a second and is hardly noticeable.

Let me know if you need further information or if you would like to use this an an answer.

- Mike
0
 
LVL 2

Expert Comment

by:mbreuker
ID: 1572304
I see that someone else submitted an answer while I was typing this "Thesis."
I will only point out that Windows 95 does not contain the environment variables that are listed (only NT does this which is why login scripts for NT are a hell of a lot easier) and thus the need to use the NET CONFIG + FIND routines I have described.

Good Luck.
0
 

Author Comment

by:mamorian
ID: 1572305
The hidden share portion of your answer does not pertain to my question.

The built in variables you mention do not apply to Windows95.


0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 2

Expert Comment

by:mbreuker
ID: 1572306
Have you had a chance to look at my comment?
0
 
LVL 3

Expert Comment

by:TSauer
ID: 1572307
Try using Kixtart, in the newer versions there is a support for this variables not supported by standard.
0
 

Author Comment

by:mamorian
ID: 1572308
Using mbreuker's response, I was able to do exactly what I needed to do.  Could not have been a better answer.

I will however look at Kixtart simply to get familiar with it.

Thanks all.
0
 
LVL 2

Accepted Solution

by:
mbreuker earned 200 total points
ID: 1572309
I thought I answered this already, but maybe it did not register. Anyway, glaad I could help.
0
 

Author Comment

by:mamorian
ID: 1572310
could not have been more on.  I am using these tricks in production right now.....
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Have you ever set up your wireless router at home or in the office to find that you little pop-up bubble in the bottom right-hand corner of Windows read "IP Conflict - One of more computers on the network have been assigned the following IP address"…
Many of us in IT utilize a combination of roaming profiles and folder redirection to ensure user information carries over from one workstation to another; in my environment, it was to enable virtualization without needing a separate desktop for each…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now