VB Script does not run
Posted on 2013-06-10
My vb script is supposed to list all filenames in a folder as defined by Path. Please help me figure out why the script isn't running.
Here's the script:
Path = "\\domain-01.com\dfs$\care-one\users\care-one_nanthony\desktop\Report"
Select Case WScript.Arguments.Count
Case 0: Path = "*.*" ' list current directory
Case 1: Path = WScript.Arguments(0)
Case Else: WScript.Echo "Invalid number of arguments.": Exit Sub
Dim a: a = ListDir(Path)
If UBound(a) = -1 then
WScript.Echo "No files found."
For Each FileName In a
MsgBox "All Done!"