PDA

View Full Version : run-once login script? (W2K)



sid_h
05-26-2006, 09:35 AM
Is it possible for a login script to run once?
This script is a consent for users and needs to only run once. After the user agrees to all he/she may continue, and if the user doesn't then, the computer logs off. btw, this is on a domain.

Will a simple script do it?

Thanks

josefz
06-24-2006, 08:52 AM
Something like thistest.bat?

@ECHO OFF
IF EXIST "%USERPROFILE%\Local Settings\agree.txt" GOTO thereis
ECHO File is not there, launch consent question
ECHO Test the answer here; if user does not agree, then skip next line, go to disagree
ECHO Copy any existing file; "+" changes agree.txt file creation date
COPY "%windir%\win.ini" + "%windir%\win.ini" "%USERPROFILE%\Local Settings\agree.txt"
GOTO end
:disagree
ECHO log off here
GOTO end
:thereis
ECHO File is there, no action
ECHO Next line is for test purposes only (remove when debugged).
ERASE "%USERPROFILE%\Local Settings\agree.txt"
GOTO end
:end
REM Next lines are for test purposes only (remove when debugged).
REM All ECHOes are for test purposes only (replace by REMs when debugged).
pause