hi,
currently, i'm using a dos command in vbs to put contents of a folder in a text file, then opening it, reading it and displaying it. is there an easier way of doing this without writinig it to a file?
the code that i have is:
thanks for the help.
currently, i'm using a dos command in vbs to put contents of a folder in a text file, then opening it, reading it and displaying it. is there an easier way of doing this without writinig it to a file?
the code that i have is:
Code:
Set wshshell = CreateObject("WScript.Shell")
wshshell.Run("cmd.exe /c dir /b c:\my_folder\*.* > c:\test.txt")
ForReading = 1
file_name = "c:\test.txt"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(file_name, ForReading)
Do Until objFile.AtEndOfStream
content = content & objFile.ReadLine & vbcrlf
Loop
msgbox content