Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How Can I kill wscript process?? 2

Status
Not open for further replies.

vivis

IS-IT--Management
Oct 1, 2002
17
MX
Hello all!, I have a script running on a Windows 2000 Server that check a changing file on a remote server. I use the "cron" service to run my script every 2 minutes, The problem is that when the script doesn't find the file or can't access to the share the script hung, after 2 minutes the "cron" run again the script and start another 'wscript' process, so after 1 hr I have a lot of 'wscript' processes and the server's cpu load go to 100%. Is there a way to end the script after 1 minute of inactivity?? This script is very important, Please help me!!!!
Thanks in advanced!!!

Vi
Las lagrimas mas dolorosas que caen sobre una lapida son por las palabras que no se dijeron y las acciones no realizadas....
 
check into the command

wscript.timeout =

whatever number you put behind the = defines how many seconds the script will run. If it is not finished at that point, the script stops
 
Hello vivis,

When you specify the command line, add time option to it.
Code:
cscript scriptname.extension [COLOR=blue]//T:120[/color] [arguments]
Time out T:nn is in unit of sec the permitted time the script is allowed to run.

regards - tsuji
 
Thank you!!!! I did it from the command line, and it works great!!! Thanks!! = )

cscript myscript.vbs //T:nn

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top