Board index » Visual Studio » Underscore on folder name causing problem
|
ToddEllington
|
Underscore on folder name causing problem
Visual Studio337
When I execute the following code nothing happens, even though I have verified that there are subfolders under the "_Department Q Drives" folder. The other two sPath work ok, showing me the subfolders. If I change the "_Department Q Drives" to say "_Department XX Drives" I get folder not found which is correct. I am not allowed to change the folder name. Is there a work around to this problem so that I can display subfolders? Dim sPath Set FSO = CreateObject("Scripting.FileSystemObject") sPath = "\\netapp\MAIN$\_Department Q Drives" ' no error but nothing is displayed 'sPath = "\\netapp\MAIN$\__Temp" ' [2 underscores] works OK 'sPath = "\\netapp\MAIN$\Activity Log" ' works ok ShowSubfolders FSO.GetFolder(sPath) Sub ShowSubFolders(Folder) For Each Subfolder in Folder.SubFolders Wscript.Echo Subfolder.Path ShowSubFolders Subfolder Next End Sub - |
