1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| Dim stRep 'c:\Oracle\ora92
Dim oFSO,oFl
Set oFSO = CreateObject("Scripting.FileSystemObject")
stRep = "C:\Tmp"
If oFSO.FolderExists(stRep) Then
For each oFl in oFSO.GetFolder(stRep).Files
Wscript.Echo oFl.Name
Next
End If
Const ForReading = 1, ForWriting = 2
Dim oFso, f
Set oFso = CreateObject("Scripting.FileSystemObject")
Set f = oFso.OpenTextFile("c:\tmp\fichier1.txt", ForReading)
Wscript.echo f.ReadAll
f.Close
pos = InStr(4, "na", "Juillet") 'renvoie 24
pos = InStr(27,"na", "Juillet") 'renvoie 0
File.Delete("c:\copyofmyfile.txt")
Console.WriteLine("Fichier c:\copyofmyfile.txt supprimé") |
Partager