Page 1 of 1 1
Topic Options
#121784 - 2004-06-24 02:48 PM Logon Message
DarrenBolton Offline
Lurker

Registered: 2004-06-24
Posts: 4
Currently we are using Kixtart for our logon script on our Windows NT4 domain with mixed clients... 9x to xp.

Currently we have a message box that pops up when the user logs on, they then have to click ok to get rid of it.

What im wanting to know is what is the script I should use to bring up the multichoice box, so that if the user accepts the policy they remain logged on but if this press cancel, esc then they are logged off.

regards,

Top
#121785 - 2004-06-24 02:56 PM Re: Logon Message
AzzerShaw Offline
Seasoned Scripter
****

Registered: 2003-02-20
Posts: 510
Loc: Cheltenham, England
I would use messagebox

See link for details of use MessageBox

Then you could say if no to message logoff, if yes carry on

Aaron
_________________________
If at first you don't succeed, try again. Then quit. There's no use being a damn fool about it. - W.C Fields

Top
#121786 - 2004-06-24 02:57 PM Re: Logon Message
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
Something like this...

Code:

$Selection = MessageBox("Do you accept the company policy?", "Policy", 68)
If $Selection = 7 ; User selected "No"
'You must select "Yes" to logon to the domain...' ?
Logoff(1)
Endif


Top
#121787 - 2004-06-24 03:00 PM Re: Logon Message
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Code:


break on

$answer = MessageBox("Do you accept these terms?","Logon",3)

if $answer <> 6

; logoff(1)

endif

exit 1



Im getting old

Top
#121788 - 2004-06-24 03:05 PM Re: Logon Message
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
Quote:

I'm getting old




But like a fine wine you just get better with age.

Top
#121789 - 2004-06-24 03:06 PM Re: Logon Message
DarrenBolton Offline
Lurker

Registered: 2004-06-24
Posts: 4
cheers for the fast reply

Is it possible to pause the rest of the script.. ie drive mappings etc until the user clicks yes?

Also im not sure if this is possible but can u stop the desktop from loading until the use says yes?

and.... hehe is it possible to change the text on the buttons to I Accept and I Decline?


Edited by DarrenBolton (2004-06-24 03:08 PM)

Top
#121790 - 2004-06-24 03:09 PM Re: Logon Message
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
The script execution should stop until the user responds to the MessageBox. If it doesn't I'll eat a rat raw.

As far as "loading the desktop," there should be something in the FAQ forum. Checking...

Top
#121791 - 2004-06-24 03:12 PM Re: Logon Message
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
Quote:

...is it possible to change the text on the buttons to I Accept and I Decline?




Nope. Not without severely hacking the system API and changing "Yes" and "No" to "I Accept" and "I Decline" for all Yes/No buttons.

Top
#121792 - 2004-06-24 03:12 PM Re: Logon Message
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
By default, the messagebox will pause the script until the user responds. To delay the desktop build - google on the RunLogonScriptSync registry/GPO setting.
Top
#121793 - 2004-06-24 03:13 PM Re: Logon Message
DarrenBolton Offline
Lurker

Registered: 2004-06-24
Posts: 4
Quote:

By default, the messagebox will pause the script until the user responds. To delay the desktop build - google on the RunLogonScriptSync registry/GPO setting.




GPO isn't a option for us as we still have old 9x clients out and about and are running on NT4 Domains

Top
#121794 - 2004-06-24 03:14 PM Re: Logon Message
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
Or you could go to our very own FAQ
Top
#121795 - 2004-06-24 03:25 PM Re: Logon Message
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
There is also a FAQ on undocumented MessageBox() styles.

You could of course, toss the kludgy MessageBox() in favor of KiXforms and have your I Accept and I Decline.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#121796 - 2004-06-25 12:12 AM Re: Logon Message
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Hmmm... better start eating if he followed Shawn's code.

Quote:

If it doesn't I'll eat a rat raw




Quote:

break on
$answer = MessageBox("Do you accept these terms?","Logon",3)
if $answer <> 6
; logoff(1)
endif
exit 1






Hell no I don't agree CTRL-C

Top
#121797 - 2004-06-25 02:28 AM Re: Logon Message
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
Quote:

Hmmm... better start eating if he followed Shawn's code.




Nice try, Doc. Ctrl-C didn't stop the script for me. Even if it did, the question was "does script execution stop until the user responds to the messagebox," so I think I'd still be correct.

Top
#121798 - 2004-06-25 09:57 AM Re: Logon Message
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
It didn't stop the script for you because you probably use WKIX32.EXE and not KIX32.EXE

So you're gonna woose out and stick by a minor technicality over wording eh!

Dang... I was hoping to see that big old RAT dripping from your mouth.

Top
#121799 - 2004-06-25 10:12 AM Re: Logon Message
DarrenBolton Offline
Lurker

Registered: 2004-06-24
Posts: 4
thanks for all the help guys, really appreciated!

Its working a treat!

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Henriques) and 2516 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.04 seconds in which 0.019 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org