Logon script with company policies - TechRepublic
General discussion
November 19, 2003 at 05:11 AM
donkeyboy25

Logon script with company policies

by donkeyboy25 . Updated 22 years, 7 months ago

I need a script to run on a NT4 domain that will apply to W9x,NT4,2000 & XP PCs.
I have tested a utility called Winoff which forcibly logs the user off when they select an option. The final script needs to work like this:
user logs on and sees a box come up displaying our companies security policies and email policies. The only options are I AGREE and I DISAGREE
now if they select I DISAGREE it will forcibly log them off.
obviously selecting I AGREE lets them carry on loggin in using Windows.
I did a test with a basic DOS batch file and found a couple problems:
By default the script minimises itself to taskbar.So i added line -Start /max logon.bat- which worked fine, and maximised the whole DOS window, but I would have liked the DOS Windows just to stay same size but come to the foreground, infront of everything else, not maximise.
My boss has asked whether we can get a better looking interface as DOS Windows aren’t that pretty.
If anyone can help me with some code in something like vbscript or javascript for the test script below I would be very appreciated.
Also, is it possible for script to run before Windows loads on NT4 domain??
How do I stop the users closing script down and ignoring the question??

@ECHO OFF
:START
CLS
SET MyInput=
IF NOT ‘%1’==” GOTO QUIT_MENU
ECHO 1. Yes I love working here
ECHO 2. No I absolutely hate it
ECHO 3. I’m only here because the misses is at home
ECHO 4. I have 5 credit cards to pay off, god damn it
ECHO 5. Quit
SET /P MyInput=Please choose how you feel about working at UBHT:
IF %MyInput% == 5 GOTO QUIT_MENU
IF %MyInput% == 4 GOTO CREDIT
IF %MyInput% == 3 GOTO MISSES
IF %MyInput% == 2 GOTO NO
IF %MyInput% == 1 GOTO YES
:YES
ECHO HA HA HA
PAUSE
GOTO START
:NO
ECHO You know where the door is
PAUSE
GOTO START
:MISSES
ECHO Ditch the chick, go on the doll
PAUSE
GOTO START
:CREDIT
ECHO Stop buying porn and cut up your credit cards
PAUSE
GOTO START
:QUIT_MENU
START WinOFF -logoff -force

This discussion is locked

All Comments