fb:porticula NoPaste
Ordnerinhalte auflisten (Open Pipe)
Uploader: | hhr |
Datum/Zeit: | 04.07.2019 11:30:03 |
'Anstelle von Command(1) kann ein Ordnerpfad eingetragen werden.
Dim As String path = Command(1)
Dim As String afolder(), afile()
Redim aFolder(0)
Redim aFile(0)
Open Pipe "DIR /A:D /B /S " & Chr(34) & path & Chr(34) For Input As #1
Do Until Eof(1)
Redim Preserve aFolder(Ubound(aFolder) + 1)
Line Input #1, aFolder(Ubound(aFolder))
Loop
Close #1
Open Pipe "DIR /A:-D /B /S " & Chr(34) & path & Chr(34) For Input As #1
Do Until Eof(1)
Redim Preserve aFile(Ubound(aFile) + 1)
Line Input #1, aFile(Ubound(aFile))
Loop
Close #1
Print path
Print "Files:"; Ubound(afile)
Print "Folders:"; Ubound(afolder)
Print "-- More --" : Sleep
Dim As Ulong i
For i = 1 To Ubound(afolder)
Print i; " Folder: "; afolder(i)
Next i
For i = 1 To Ubound(afile)
Print i; " File: "; afile(i)
Next i
Sleep
End
'