Login | |
|
 |
Script Replication - 8/30/2006 11:31:22 AM
|
|
 |
|
| |
takeda kozo
Posts: 83
Score: 0
Joined: 11/9/2005
Status: offline
|
Hi All, I am writing a script which will connect to a list of hostnames and then retrieve certain items from the registry etc (hotfix info, pc serial number etc) The host list is rather large, so I want to split the task among 4 identical scripts, so that they can simultaneously gather this info. If I use the master script (the engine) to make 3 copies of the scanning script, then how can I edit the script content inside these copies before launching them ? (the scanning scripts are identical except for a single line): ScriptNo = "1" (so at the end, every script should look the same, except they will each have a unique line which states their script number Copying should be ok, but I dont know how to edit the content of a script !!!! Any help would be appreciated :) Const OverwriteExisting = TRUE Set objFSO = CreateObject("Scripting.FileSystemObject") For i = 1 to 4 objFSO.CopyFile "C:\temp\scanner.vbs" , "C:\temp\working\scanner_" & i & ".vbs", OverwriteExisting Next One other thing, is there a way to store the contents (the code) for the scanner script WITHIN the master script ? so that the whole package can be maintained in a single script file ? (for example, copy lines 100 to line 300 into a new script called scanner_1, scanner_2 etc ? Cheers, TK
|
|
| |
|
|
|
 |
RE: Script Replication - 8/31/2006 1:33:19 AM
|
|
 |
|
| |
ebgreen
Posts: 5246
Score: 31
Joined: 7/12/2005
Status: online
|
Rather than altering the script copies, I would have the script copies accept one command line parameter that is their script number. Then the master script can simply call the same file 4 times and pass a different script number to each one.
_____________________________
"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm http://www.visualbasicscript.com/m_47117/tm.htm
|
|
| |
|
|
|
 |
RE: Script Replication - 8/31/2006 5:03:54 AM
|
|
 |
|
| |
mbouchard
Posts: 1924
Score: 16
Joined: 5/15/2003
From: USA
Status: offline
|
Alternativly to ebgreens suggestion, you can let the name of the file determine the script number. ScriptNumber = right(fso.GetBasename(wscript.scriptname),1)
_____________________________
Mike For useful Scripting links see the Read Me First stickey! Always remember Search is your friend.
|
|
| |
|
|
|
|
|