This snippet runs a script against multiple computers taken from a text file. A big time saver.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | 'Create a FileSystemObject Set oFS = CreateObject("Scripting.FileSystemObject") 'Open a text file of computer names 'with one computer name per line Set oTS = oFS.OpenTextFile("c:computers.txt") 'go through the text file Do Until oTS.AtEndOfStream 'get the next computer name 'store it in variable sComputer sComputer = oTS.ReadLine '----------------------------------- ' YOUR CODE HERE - code will ' affect each computer in the ' input text file '----------------------------------- Loop 'close the text file oTS.Close MsgBox "Done!" |


Posted in
Tags: