Solved

Windows NT Login Scripts with Windows95 Client

Posted on 1999-01-28
9
365 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
Simple, centralized multimedia control

Watch and learn to see how ATEN provided an easy and effective way for three jointly-owned pubs to control the 60 televisions located across their three venues utilizing the ATEN Control System, Modular Matrix Switch and HDBaseT extenders.

 

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

Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

Question has a verified solution.

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

FIPS stands for the Federal Information Processing Standardisation and FIPS 140-2 is a collection of standards that are generically associated with hardware and software cryptography. In most cases, people can refer to this as the method of encrypti…
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…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

730 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