Page 1 of 1 1
Topic Options
#142575 - 2005-06-28 05:21 PM Logonscript / Query Process NT/2k/XP
Maik Offline
Getting the hang of it

Registered: 2003-01-14
Posts: 87
Hello,
I must call several EXE Files in my logonscript within the user logon process. Sometimes an
EXE "hangs" and so the logon process fails or hangs.

Is it possible to track the runtime of an EXE so if the process hangs the script kill the
EXE (Process) automatically after a defined time and the logon process goes on?

Regards
Maik

Top
#142576 - 2005-06-28 06:30 PM Re: Logonscript / Query Process NT/2k/XP
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Yes, but it's not easy.

You need to spawn the process using "RUN", which will run it in parallel. Now you use WMI to find the running process and check it every (say) 0.1 seconds. If it's still running after your timeout you can kill it. There are UDFs available in the UDF forum for finding processes and killing them.

If the program creates a window you can also use AutoIT to control it, but that requires the AutoIT DLL to be installed on all your PCs that will log in.

[edit]
Oops - said SHELL, meant RUN
[/edit]


Edited by Richard H. (2005-06-28 06:39 PM)

Top
#142577 - 2005-06-28 06:34 PM Re: Logonscript / Query Process NT/2k/XP
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
you can remove the hang by using RUN instead of shell or writing the execution command to run key in registry.

but, yes, it is possible to monitor active processes.
search the board for example scripts.
_________________________
!

download KiXnet

Top
#142578 - 2005-06-28 08:03 PM Re: Logonscript / Query Process NT/2k/XP
Maik Offline
Getting the hang of it

Registered: 2003-01-14
Posts: 87
I found the UDF "EnumProcess" that may fit my needs. But how can I check the specific process for, let's say, 2 minutes and after that "kill" it?

Maik

Top
#142579 - 2005-06-28 08:15 PM Re: Logonscript / Query Process NT/2k/XP
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
If your logon script takes 2 minutes to run, I am glad I don't work for your company!
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#142580 - 2005-06-29 09:04 AM Re: Logonscript / Query Process NT/2k/XP
Maik Offline
Getting the hang of it

Registered: 2003-01-14
Posts: 87
We are currently restructuring our backend infrastructure and due to this we are automatically change different things on the local client(LAN Setting, Memberships etc.).

If the change is done within 2 minutes all went fine and no one is hurt.

Top
#142581 - 2005-07-01 11:36 PM Re: Logonscript / Query Process NT/2k/XP
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Anything that is not directly related to the user should not be part of a login process. It is better to handle this via admin scripts, preferably remotely, and outside regular business hours.
_________________________
There are two types of vessels, submarines and targets.

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 1636 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.174 seconds in which 0.15 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