Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Kill Function after X time running

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,51794
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Kill Function after X time running
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Kill Function after X time running - 9/12/2007 9:42:52 PM   
  4scriptmoni


Posts: 208
Score: 0
Joined: 5/3/2007
Status: offline
I got a vbs that sometimes remains in running (stuck) and I would like to kill it if it runs for over x time.
I have done this inside a script that calls an .exe and stops but now it just calls a function..


      

_____________________________

Enterprise Microsoft Scripts
Exchange, Login/Logout Monitor,TS, Monitoring, Security, AD, etc...
http://www.felipeferreira.net
 
 
Post #: 1
 
 RE: Kill Function after X time running - 9/13/2007 12:30:35 AM   
  ebgreen


Posts: 5037
Score: 31
Joined: 7/12/2005
Status: online
Istead of doing KillProcess(), just do Exit Function.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to 4scriptmoni)
 
 
Post #: 2
 
 RE: Kill Function after X time running - 9/13/2007 6:17:16 PM   
  4scriptmoni


Posts: 208
Score: 0
Joined: 5/3/2007
Status: offline
In the example I was calling a shell (.exe) where I was using   objExecObject.Status <> 1    , how do I use the same for funciton?

function name.status?

_____________________________

Enterprise Microsoft Scripts
Exchange, Login/Logout Monitor,TS, Monitoring, Security, AD, etc...
http://www.felipeferreira.net

(in reply to ebgreen)
 
 
Post #: 3
 
 RE: Kill Function after X time running - 9/14/2007 12:00:13 AM   
  ebgreen


Posts: 5037
Score: 31
Joined: 7/12/2005
Status: online
Oh, I understand. What you need to do is to do the timing in the function. Then exit the function after x amount of time.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to 4scriptmoni)
 
 
Post #: 4
 
 RE: Kill Function after X time running - 9/14/2007 12:33:51 AM   
  4scriptmoni


Posts: 208
Score: 0
Joined: 5/3/2007
Status: offline
Thanks, but I didnt get how to use it correctly, not sure where to place it.
But its ok ins schedulle task i made it if runs for over 5min to kill it.. it should do it

_____________________________

Enterprise Microsoft Scripts
Exchange, Login/Logout Monitor,TS, Monitoring, Security, AD, etc...
http://www.felipeferreira.net

(in reply to ebgreen)
 
 
Post #: 5
 
 RE: Kill Function after X time running - 9/14/2007 7:26:19 PM   
  DiGiTAL.SkReAM


Posts: 1184
Score: 7
Joined: 9/6/2005
From: Florida, USA
Status: offline

      


_____________________________

"Would you like to touch my monkey?" - Dieter (Mike Meyers)

"It is better to die like a tiger, than to live like a pussy."
-Master Wong, from Balls of Fury

(in reply to 4scriptmoni)
 
 
Post #: 6
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Kill Function after X time running Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts