Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Wait for the completion of a task, before continuing.

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> Post a VBScript >> Wait for the completion of a task, before continuing.
  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 >>
 Wait for the completion of a task, before continuing. - 10/22/2008 5:44:27 AM   
  jfieldsx2416

 

Posts: 3
Score: 0
Joined: 10/22/2008
Status: offline
I wrote this function to use when launching multiple CScripts to handle various functions. Since it uses WMI interface and I can specify a computer name for the query, I added the computer name as a value for the function.


      

This function I wrote so I could wait until I only ended up with 1 cscript or 1 wscript left running. (When launching multiple cscripts)


      

You call this as
quote:

Do Until NumberofProcesses(".", "cscript.exe") = 1
   WScript.echo "They're still working!"
Loop


This function relies on another function I wrote.


      

This function simply returns an array of the Processes on whatever computer specified (ProcessList("."))

Hope this helps someone! :)

I plan on posting more code on here... A lot of the code I have was because I had some problem to solve in the course of administrating a multi-location network.

Enjoy!

< Message edited by jfieldsx2416 -- 10/22/2008 5:47:36 AM >
 
 
Post #: 1
 
 RE: Wait for the completion of a task, before continuing. - 11/15/2008 5:51:43 AM   
  X BiLe


Posts: 12
Score: 0
Joined: 6/18/2008
Status: offline
just out of curiosity...you creating a loop with no pause time at all, does doing this cause a spike in processor usage?

(in reply to jfieldsx2416)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> Post a VBScript >> Wait for the completion of a task, before continuing. 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