Script Examples vbscript autoit php batch

Search for Textstring in file


kommt Suchtext in einer Datei vor

Const ForReading = 1
strdatei = Wscript.Arguments(0)
suche = Wscript.Arguments(1)
Set objFSO = CreateObject("Scripting.FileSystemObject")

Set objTest = objFSO.GetFile(strdatei)
If objTest.Size > 0 Then
    Set objFile = objFSO.OpenTextFile(strdatei, ForReading)
    strText = objFile.ReadAll
    objFile.Close

    found = InStr(1, strText,suche)
    if found > 0 then
      WScript.Echo "gefunden"
    End If
End If
<<< read file in vbscript Replace strings in file vbscript >>>


neue Themen

Stichwortsuche auf dieser Seite:
04.07.2009 07:24 zZ 1 Leser online
Powered by cms.libe.net 2004-2009