#138531 - 2005-04-27 08:48 PM
Re: Services?
|
pat_smith1969
Fresh Scripter
Registered: 2005-04-19
Posts: 18
|
I could have sworn I replied to this already... must not have hit submit.
The last code listed (fnWMIService()) worked Great for me and it is working 100%. After doing a ton of research on the Microsoft boards I have a thoery about why I was having problems. It seems that a simple write statement to the registry does not update the Service Monitor properly. So even though the setting was correct the service Control Monitor Service was not being updated and it still thought it was in a state of disabled.
Using the WMI function uses the correct API which DOES update the Service Control Monitor service and thus it works.
Thanks for all your help guys.
One last question.... and this one is kinda stupid...
Everyone starts their scripts with a Break ON statement. 1) what does that do? 2) should I ever do a Break Off? maybe at the end of my scripts? 3) should I have a Break On statement at the start of EACH section of my logon script or do I turn on the Break just once?
Before you flame me ... please remember this is the "starters" forum.
|
|
Top
|
|
|
|
#138532 - 2005-04-27 09:13 PM
Re: Services?
|
Chris S.
MM club member
   
Registered: 2002-03-18
Posts: 2368
Loc: Earth
|
From the 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.
To prevent logging off while testing scripts, most of us use 'Break On.' It becomes such a habit that we include it when posting script samples (and even in production scripts).
|
|
Top
|
|
|
|
#138533 - 2005-04-27 09:22 PM
Re: Services?
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Break ON permits you to stop your script without having KiXtart logout of the current session if it is killed.
When Break is OFF then you can not Ctrl-C to stop an infinite loop. If you then close the window. KiXtart will log you off. This can be very annoying.
I start my production logon script with Break OFF.
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 987 anonymous users online.
|
|
|