Solved

Windows NT Login Scripts with Windows95 Client

Posted on 1999-01-28
9
366 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 

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
 
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

Building an interactive eFuture classroom

Watch and learn how ATEN provided a total control system solution including seamless switching matrix switch, HDBaseT extenders, PDU, lighting control to build an interactive eFuture classroom.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes you might need to configure routing based not only on destination IP address, but also on a combination of destination IP address (or hostname) and destination port number. I will describe a method how to accomplish this with free tools. …
Are you one of those front-line IT Service Desk staff fielding calls, replying to emails, all-the-while working to resolve end-user technological nightmares? I am! That's why I have put together this brief overview of tools and techniques I use in o…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

690 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