Page 1 of 1 1
Topic Options
#113518 - 2004-02-06 10:10 PM Closing console window logs user off system!
beerslayer Offline
Fresh Scripter

Registered: 2003-12-10
Posts: 15
I hope someone can show me what I'm doing wrong here...

I have a script that contains a SLEEP statement. This script is launched from a batch file using a statement of the form "start /min kix32 myscript.kix", which generates a minimized console window for the KiX script to run in.

To my complete horror, I discovered that by clicking the close box on that console window (the standard 'X' in the upper right corner), not only does it terminate the KiX script, but it logs the user off the machine entirely! This is quite undesirable for a variety of reasons, not least of which that the user loses his dial-up connection and whatever else he/she might have been working on.

To see this behaviour, all you need to do is to create a KiX script with the following one line of Code:
SLEEP 30

launch it, and then click the Close button on the window during the 30-second sleep period.

(I'm running this under Windows 2000 SP4, if that makes any difference...)

Was this intended behaviour on the part of the KiX designers, or is it simply a bug? If it is desired behaviour, is there some way to disable it? Curious users will click whatever they want to click - they shouldn't be kicked out of the system for trying to close a window!

Thanks in advance,

-- Jeff
-- aka The Eternal Newbie
_________________________

Top
#113519 - 2004-02-06 10:28 PM Re: Closing console window logs user off system!
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
This is intended behavior and perfectly well documented in the KiXtart Manual. See BREAK in the KiXtart Manual.
Quote:


By default, to prevent users from inadvertently interrupting a script, KiXtart automatically disables the ctrl+c/break keys, disables the Close command in the System menu of the current command-prompt window, and hides the Please wait while your logon script executes message box on Windows 9x.

In a multi-tasking environment such as Windows NT, you cannot fully prevent users from interrupting a program. (They can end programs by using the Task List, for example.) As an additional protection, on computers running Windows NT or Windows 2000 only, when BREAK is OFF (the default) KiXtart also installs a special event handler for the current console. The effect of this handler is that whenever a user forcibly terminates KiXtart, the user is automatically logged off. This means that you must be careful when testing scripts.

Tip> On Windows 9X, the Please wait while your logon script executes message box contains a Cancel button, which you can hide by opening a copy of Msnet32.dll in Visual C 4.00 WorkBench, selecting the LMWINSCRIPTDLG resource, and making the Cancel button invisible.



_________________________
There are two types of vessels, submarines and targets.

Top
#113520 - 2004-02-06 10:53 PM Re: Closing console window logs user off system!
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
k, there is error in the manual.
need to talk to ruud about that.

in fact, if you forcibly try to end kix-process, it will end and no affect on user.
but if you try to nicely close it, it will log you off.

but, if you just want the X to work as documented (there goes another error in the manual), you need to use wkix32 as the old console version (kix32) does not disable the X.
_________________________
!

download KiXnet

Top
#113521 - 2004-02-06 10:53 PM Re: Closing console window logs user off system!
beerslayer Offline
Fresh Scripter

Registered: 2003-12-10
Posts: 15
Quote:

As an additional protection, on computers running Windows NT or Windows 2000 only, when BREAK is OFF (the default) KiXtart also installs a special event handler for the current console. The effect of this handler is that whenever a user forcibly terminates KiXtart, the user is automatically logged off.



I figured it might be something like that, but I do not have the manual memorized. Thanks for the quote!

Is there a way to turn this off globally (i.e. disable this feature for all scripts) - perhaps with an entry in the registry or in an .INI file - or must one put the BREAK ON statement in every single script in order to prevent this (to me, highly undesirable) behaviour?

-- Jeff
-- aka The Eternal Newbie
_________________________

Top
#113522 - 2004-02-06 11:20 PM Re: Closing console window logs user off system!
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
BREAK ON in the only way. However, I do not understand why this is undesirable?
_________________________
There are two types of vessels, submarines and targets.

Top
#113523 - 2004-02-06 11:26 PM Re: Closing console window logs user off system!
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
ja.
and like I already advertized wkix32, I must still keep doing so.
if you insist on hitting the close button, switch over to wkix32.
if you are considered about users, use wkix32 as it runs totally without console if you don't tell it to create one.
_________________________
!

download KiXnet

Top
#113524 - 2004-02-06 11:29 PM Re: Closing console window logs user off system!
beerslayer Offline
Fresh Scripter

Registered: 2003-12-10
Posts: 15
Quote:

I do not understand why this is undesirable?



I thought I had already explained that.

I don't care if users close the window manually. Even if they get to a command prompt, there's nothing they can do there that concerns me.

I don't need this "security" feature. To me, all it does is cause problems by logging users off when I don't want it to do so. I don't ever want a user logged off except under my direct control, which is something I don't have in this situation.

I would like some way to disable it globally, as it has no redeeming quality for me in any situation I can imagine.

-- Jeff
-- aka The Eternal Newbie
_________________________

Top
#113525 - 2004-02-06 11:34 PM Re: Closing console window logs user off system!
beerslayer Offline
Fresh Scripter

Registered: 2003-12-10
Posts: 15
I'll try it. Thanks.
_________________________

Top
#113526 - 2004-02-06 11:41 PM Re: Closing console window logs user off system!
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
You still have not explained why you are unable to use BREAK ON in a script. Also, you've been told that using WKIX32 would also solve the problem as you then don't even have a console window (with a properly written script).

Edited by sealeopard (2004-02-06 11:41 PM)
_________________________
There are two types of vessels, submarines and targets.

Top
#113527 - 2004-02-06 11:53 PM Re: Closing console window logs user off system!
beerslayer Offline
Fresh Scripter

Registered: 2003-12-10
Posts: 15
Quote:

You still have not explained why you are unable to use BREAK ON in a script. Also, you've been told that using WKIX32 would also solve the problem as you then don't even have a console window (with a properly written script).



I never said I was unable to do so, merely that I find it to be an inconvenience to have to remember to do so every time I write a new script.

Plus, I have said that I would try wkix32 as an alternative.

What else do you want from me?

-- Jeff
-- aka The Eternal Newbie
_________________________

Top
#113528 - 2004-02-07 12:35 AM Re: Closing console window logs user off system!
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
think jens has a point in his queries.
as a starters...
why should you allow your users to stop kix from running if it's their script that only helps them?
if it's not a "policy" thing, ok.
but normally they are, so the user shouldn't be able to f*** it up.
but, to delete the change of being logged off, indeed wkix32 is the answer.
if they really go to taskmanager and kill it, they are "crackers" and they should be panished.
like, why they would do that except for teasing you and making your life harder.

and that's why I fell in love with wkix32 right from the start of 4.00 devel builds.
kix32 is so DOShie
_________________________
!

download KiXnet

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
0 registered and 764 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.071 seconds in which 0.032 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