What do you mean by the contents of a folder? The file names?
If that's the case, use the IO namespace
Dim fileName As String
Dim files As String()
Dim dirApp As String = "\\servername\path\"
files = IO.Directory.GetFiles(dirApp, "*.txt")
For Each fileName In files
RunSomeScript(fileName)
Next
If you want to get all files in the directory clear the "*.txt" from the GetFiles Parameters.