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 script problem with logic

Status
Not open for further replies.

radvibes

IS-IT--Management
Dec 11, 2002
18
US
I am trying to run a password change exe in the login script. It runs fine, but I only want it to run one time. Is there a way to have the file only run once in the login script without having to remove it right away.

The only other alternative I have come up with is, a certain file is copied to the c: drive the first time the script is ran. Can I use an If statement saying something like If C:\file.exe exists, then do not run else run or something similar to this. I could not find any help on novells wonderful site.

thanks
 
I would go for a batch file and call the batch file from the login script. Then, you can use the IF statement as you wish - I do not think you can check for the existence of a file using the IF statement in a login script. Your login script would look like this (must include the #):

#checkpw.bat

Your checkpw.bat (example name) would look like this (exclude the --- lines as that is just my way of defining the start and end of the batch file, checkpw.exe is the name I have used for your password EXE for example):

---------------------------------------------------------
@echo off
if exist c:\checkpw.txt goto end

:check
checkpw.exe
type Password Changed > c:\checkpw.txt

:end
---------------------------------------------------------

Just a work around that should work for you. -----------------------------------------------------
"It's true, its damn true!"
-----------------------------------------------------
 
Hi.

You could create an "Application Object" in NWAdmin or Console One to launch the "password change" executable. Not sure about Console One, but NWAdmin allowed you to choose whether to "run-once" or each time a person logged in.

HTH

Mark
 
The application object I think would be a great way to go. There is still the Run once option within the nal, and you could also set dependency of a file on the c:\ if you would want to know like the day it was run on a particular machine or not.

Even better you could schedule it to run on a particular day each month or whatever.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top