
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