#113518 - 2004-02-06 10:10 PM
Closing console window logs user off system!
|
beerslayer
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
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
|
|
|
|
#113524 - 2004-02-06 11:29 PM
Re: Closing console window logs user off system!
|
beerslayer
Fresh Scripter
Registered: 2003-12-10
Posts: 15
|
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 699 anonymous users online.
|
|
|