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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

login scripts 1

Status
Not open for further replies.

drenaker

IS-IT--Management
Jul 28, 2001
14
US
I would like to check for the existence of a file on the users PC when they login. If successful then write to a file theuser names.

From the login script.
I execute an external DOS program to test for existence.
Write to a file if exist.

The script works from DOS.
The login script is executing the DOS script.
But I can not pass any variables to the DOS script.
Tried LOGIN_NAME
Tried FULL_NAME
Tried %1

Any ideas on an easy way to do this?
 
You can call batch files and .exe from a login script, but you will have to use the '#' in front of the command. It will also depend on the contents of the file you are calling. For the commands you mention above they are %LOGIN_NAME and %FULL_NAME.

What is it in the bach file you are trying to do?

Simon.
 
You can also use the '@' in front of external-to-login-script commands. I believe the difference is the login script waits for the '#' command to finish before continuing the script, whereas the '@' causes the script to continue on while the batch or whatever is executing. Either can be useful depending on the situation.
 
Simon,

Yes I tried the variables with the %FULL_NAME. I ended up searching the registry for the user login name from the DOS command. I will try the @ symbol as this is a perfect script to execute in the background.

Maybe I am trying the wrong approach. There is a virus out there that leaves a signature file scam32.exe. I am executing a DOS batch file to find that signature file and write to a log file. Is there an easier way in Novell? We also have a third party package which is checking for the existence of the file but this is scheduled for once a week inventory. I was looking for a quick easy way to log the occurance of the file.
 
I would recommend that you isntall McAfee;s Netshield or Nortons antivirus on all workstations and the servers. That way you don't have to spend valuable time trying to find out who has the virus. You can have McAfee setup to create a log on the server when users login and if there is a virus present, you will know who it is and what was affected...etc...

Mark

Mark C. Greenwood, CNE
m_jgreenwood@yahoo.com

CNE 4.11 and CNE 5 certified. BS Degree in MIS. Working in the industry for 8 years.

I work with NT servers, NDS for NT as well.

 
Virus protection is always a good resource but look at code red. Most people did not get a update until after the damage was done.
1. We have 2000 employees and this virus is already on some PCs.
2. Updated Virus software may detect the virus but does not clean up the virus. This solves future attacks from this virus.
3. There is a seperate utility to clean up the virus because the current virus software does not clean the virus.
4. We need a proactive way to find out who is left to clean.
5. The old method takes a week of cycle scan time which is almost complete.
6. This was just an example of us trying to use the login script to come to a quick clean resolution of an issue. In this case it was a virus. Next week it may be who has cyber cop on there system scanning our networks, etc, etc,

I appreciate everyones help. I just have not found Novell shell scripts tips and tricks in the book of the month club.
 
Hi,
Just read your post, if you still have not found a solution let me add my two cents. I have been using a similar technique to what you have described for about 6 years. I started with running a DOS Anti-Virus program from the Login Script with a Batch file to scan all the workstation C: drives, most of the work is done through the use of the AV program switches including creating a log file on the users home directory. Due to the fact that Windows crashes frequently it soon got to be a nuesence to wait for it to run everytime. I found a DOS file called Once.com that I used to control how often the batch file ran. Once.com leaves a small Text file on the C: drive and checks the date the next time it executes. You call Once from the login script add a variable (the frequency in days) and the batch file name to run. I've used it with Netware 3.12, 4.11 and 5.0 also Windows 3.1, 95, 98, ME and 2000.
I use it to copy files to the workstations, clean up the Temp directory and update the AV signatures on the local desktops. It was a freeware program I found somewhere ?? in a DOS Utilities site. It has been worth its weight in gold.

HTH
Ken
 
You need to put a line like this:

DOS SET WHO="%LOGIN_NAME"

in the loging script before you call the batch file. This will set a dos variable WHO which you can then refer to in the batch file e.g

if exist c:\autoexec.bat echo "its there">f:\logs\%who%

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top