Tol!k

|
Posted: Wed Aug 11, 2010 21:58 Post subject: |
|
|
Quote: | как создать цикл, в которым будет пронумеровываться полученный список |
Code: | wmic logicaldisk where (FileSystem="NTFS") get Name /value >ntfs.txt | — это обрабатываемый список
Code: | Dim fso, InFile, Cnt, Str, Strngs, ts, nn, rr
Set fso = CreateObject("Scripting.FileSystemObject")
InFile = "ntfs.txt"
Set ts = fso.OpenTextFile(InFile,1)
Cnt = 0
Strngs = ""
Do Until ts.AtEndOfStream
Str = ts.ReadLine
rr = Split(Str, "=")
nn = UBound(rr)
Letter = rr(nn)
If nn >0 Then
Strngs = Strngs & "Disk(" & CStr(Cnt) & ") " & Replace(Letter, Chr(0), "")
Cnt = Cnt+1
End If
Loop
WScript.Echo(Strngs)
ts.Close
Set ts = Nothing
Set fso = Nothing
WScript.Quit |
|
|