- Dim FSO, Text, vbStr, Arr, Str, OutStr
- Set FSO = CreateObject("Scripting.FileSystemObject")
- vbStr = FSO.OpenTextFile("a.txt").ReadAll()
- Arr = Split(vbStr, vbCrLf)
- For Each Str In Arr
- OutStr = OutStr & Right(Str, 32) & vbCrLf
- Next
- FSO.OpenTextFile("a.txt", 2, True).Write OutStr
- Set FSO = Nothing
- CreateObject("Wscript.Shell").Run "a.txt"
复制代码 保存为test.vbs运行 |