WSH 5.6 Beta WshRemote object 
Author Message
 WSH 5.6 Beta WshRemote object

Was wondering if there was any way to use this object to administer the same
script to several different remote machines simultaneously, or if it has to
go down the list of machines (listed in the script) and do them one by one.

Thanks,
jc



Fri, 23 May 2003 03:00:00 GMT  
 WSH 5.6 Beta WshRemote object
No, you'll have to create separate WshRemote objects for each machine by
calling CreateScript for each machine.  Don't forget that once you call
WshRemote.Execute that execution is asynchronous.

If you want to wait for each one to finish,

-- Store a reference to each one you create/execute in a dictionary object.
-- Set up a polling loop in with a wscript.sleep in it (so you don't eat too
many CPU cycles).
-- On each pass through the loop, check the status of each WshRemote object
in the dictionary.  Remove each one when the status indicates that it's no
longer running.
-- Keep looping and sleeping until the dictionary's count goes to 0 or you
hit some self-imposed time limit and (assuming it's safe to do so) call
terminate on those that don't complete.

--
Michael Harris
Microsoft.MVP.Scripting
--

Please do not email questions - post them to the newsgroup instead.
--


Quote:
> Was wondering if there was any way to use this object to administer the
same
> script to several different remote machines simultaneously, or if it has
to
> go down the list of machines (listed in the script) and do them one by
one.

> Thanks,
> jc



Fri, 23 May 2003 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. WSH 5.6 beta 1 - WshController and WshRemote example

2. WSH bug status (pre-WSH 5.6 beta)

3. WSH 5.6 beta 2

4. WSH 5.6 Beta - Shell.Exec

5. WSH 5.6 Beta for NT missing files?

6. WSH 5.6 beta 2

7. Possible WSH 5.6 beta update...

8. wsh 5.6 beta 2 problems

9. wsh 5.6 beta 2 bug - floppy access during exec

10. crash with WSH 5.6 beta 2 and IE 5.5

11. WSH 5.6 Beta 1, new method, WScript.Exec

12. WSH 5.6 beta 2

 

 
Powered by phpBB® Forum Software