Hi
Can you help with amending this code, so it no longer looks at the boot ini, but will look at apx 200 separate texts files called "textfile1.txt" "textfile2.txt" etc etc consecutively for the line of text "Max100" and remove and replace with "max200"
This is a piece of code from a previous script that locates the boot.ini at c:\boot.ini and searches it for a dupe entry and removes it... any help would be appreciated
Thanks in advance
' /* Edit Boot.ini's Timeout Line */
call edit_bootini("c:\boot.ini")
sub edit_bootini(bootpath)
dim objFileSystem
' /* Get The File System Object */
set objFileSystem = createobject("Scripting.FileSystemObject")
' /* Get The file Object (For Properties) */
Set file = objFileSystem.GetFile(bootpath)
' /* Set The File's Attributes To Normal (not system, hidden, or read only) */
file.Attributes = 0
' /* open bootpath (path to boot.ini, passed to sub from calling procedure) for reading */
Set objInputFile = objFileSystem.OpenTextFile(bootpath, 1)
' /* Read In the Entire file, and rip it apart by the newline character, storing it in an array */
inputData = Split(objInputFile.ReadAll, vbNewline)
' /* Set Our Counter Variable to 0 */
cnt = 0
' /* For Each Element In our Array (for each line of the file) */
For each strData In inputData
' /* If the first 7 characters of this line of the file is "timeout" then */
if left(lcase(strData), 7) = "timeout" then
' /* change This Array's Value (This Line of the file) */
inputData(cnt) = "timeout=10"
end if
' /* Add One to Our Counter Varaible */
cnt = cnt + 1
Next
' /* Close The File, No changes have been to the file, only to the array (variable) that holds the lines of the file */
objInputFile.Close
' /* Create An Object To overwrite the file indicated by bootpath */
Set objOutputFile = objFileSystem.CreateTextFile(bootpath, TRUE)
' /* For each element in our array (each line of the file, Modified from original) */
for each strData in inputData
' /* Write That Line to The File */
objOutputFile.WriteLine strData
next
' /* Close the File (now saved with new changes) */
objOutputfile.Close
' /* Set The file To system and hidden attributes */
file.Attributes = 6
' /* Clear The File System Object */
Set objFileSystem = Nothing