Hello
I have a script that i want to use to search a remote PC (StrComputer) for any .mp3 files in a specified location (StrDir).
When the script runs i get a "path not found" at line 20 char 5.
Anyone have any ideas as to why?
Here is the script:
Input = InputBox("Enter the Machine IP To Search")
StrComputer = Input
StrDriveMap = "\\" & StrComputer & "\c$\Documents and Settings\"
strDir = StrDriveMap
Set FSO = Wscript.CreateObject("Scripting.FileSystemObject")
getInfo(strDir)
'wscript.Echo "Search Complete"
Sub SearchFiles(aItem)
Select Case LCase(Right(Cstr(aItem.Name), 3))
Case "mp3"
wscript.Echo "FILE FOUND: " & aItem.Name
End Select
End Sub
Sub getInfo(strDir)
Set objDir = FSO.GetFolder(strDir) **This is the line**
For Each FileItem In objDir.Files
SearchFiles(FileItem)
Next
For Each NextFileItem In objDir.SubFolders
' wscript.Echo "Parsing Folder: " & NextFileItem.Name
getInfo(NextFileItem)
Next
End Sub
Any help would be appreciated.
I have a script that i want to use to search a remote PC (StrComputer) for any .mp3 files in a specified location (StrDir).
When the script runs i get a "path not found" at line 20 char 5.
Anyone have any ideas as to why?
Here is the script:
Input = InputBox("Enter the Machine IP To Search")
StrComputer = Input
StrDriveMap = "\\" & StrComputer & "\c$\Documents and Settings\"
strDir = StrDriveMap
Set FSO = Wscript.CreateObject("Scripting.FileSystemObject")
getInfo(strDir)
'wscript.Echo "Search Complete"
Sub SearchFiles(aItem)
Select Case LCase(Right(Cstr(aItem.Name), 3))
Case "mp3"
wscript.Echo "FILE FOUND: " & aItem.Name
End Select
End Sub
Sub getInfo(strDir)
Set objDir = FSO.GetFolder(strDir) **This is the line**
For Each FileItem In objDir.Files
SearchFiles(FileItem)
Next
For Each NextFileItem In objDir.SubFolders
' wscript.Echo "Parsing Folder: " & NextFileItem.Name
getInfo(NextFileItem)
Next
End Sub
Any help would be appreciated.