Cannot get directory list. Thanks for the info. Message Closed.
-
Problem:Cannot get directory list for "C:\Users\Public\Public Documents" which on my system contains "C:\Users\public\public Documents\Hewlett-Packard" I hope I am not making some silly error again. Have tried to use SHGetKnownFolderPath("{ED4824AF-DCE4-45A8-81E2-FC7965083634}") ' PublicDocuments which returns this path: "C:\Users\Public\Documents". When I use Directory.GetDirectories("C:\Users\Public\Documents") it returns these folders: "C:\Users\Public\My Music" "C:\Users\Public\My Pictures" "C:\Users\Public\My Videos" and "C:\Users\Public\Hewlitt-Packard" This last one is the one I'm trying to get from "Public Documents" It is actually in "C:\users\Public\Public Documents\Hewlitt-Packard" as shown in explorer. The problem is I have no way of knowing which one of the above folders is in "C:\Users\Public\Public Documents" Trying to manually get this way: Below is code with errors. Dim s As String Dim files() as String s = "c:\Users\public\public documents" ' Error - Could not find part of the path. ' or this from google search add double quotes. 's = String.Format("{0}c:\Users\public\public documents{1}", Chr(34), Chr(34)) ' Error - Illegal chars in path files = Directory.GetDirectories(s) What am i doing wrong? Thanks
-
Problem:Cannot get directory list for "C:\Users\Public\Public Documents" which on my system contains "C:\Users\public\public Documents\Hewlett-Packard" I hope I am not making some silly error again. Have tried to use SHGetKnownFolderPath("{ED4824AF-DCE4-45A8-81E2-FC7965083634}") ' PublicDocuments which returns this path: "C:\Users\Public\Documents". When I use Directory.GetDirectories("C:\Users\Public\Documents") it returns these folders: "C:\Users\Public\My Music" "C:\Users\Public\My Pictures" "C:\Users\Public\My Videos" and "C:\Users\Public\Hewlitt-Packard" This last one is the one I'm trying to get from "Public Documents" It is actually in "C:\users\Public\Public Documents\Hewlitt-Packard" as shown in explorer. The problem is I have no way of knowing which one of the above folders is in "C:\Users\Public\Public Documents" Trying to manually get this way: Below is code with errors. Dim s As String Dim files() as String s = "c:\Users\public\public documents" ' Error - Could not find part of the path. ' or this from google search add double quotes. 's = String.Format("{0}c:\Users\public\public documents{1}", Chr(34), Chr(34)) ' Error - Illegal chars in path files = Directory.GetDirectories(s) What am i doing wrong? Thanks
-
Problem:Cannot get directory list for "C:\Users\Public\Public Documents" which on my system contains "C:\Users\public\public Documents\Hewlett-Packard" I hope I am not making some silly error again. Have tried to use SHGetKnownFolderPath("{ED4824AF-DCE4-45A8-81E2-FC7965083634}") ' PublicDocuments which returns this path: "C:\Users\Public\Documents". When I use Directory.GetDirectories("C:\Users\Public\Documents") it returns these folders: "C:\Users\Public\My Music" "C:\Users\Public\My Pictures" "C:\Users\Public\My Videos" and "C:\Users\Public\Hewlitt-Packard" This last one is the one I'm trying to get from "Public Documents" It is actually in "C:\users\Public\Public Documents\Hewlitt-Packard" as shown in explorer. The problem is I have no way of knowing which one of the above folders is in "C:\Users\Public\Public Documents" Trying to manually get this way: Below is code with errors. Dim s As String Dim files() as String s = "c:\Users\public\public documents" ' Error - Could not find part of the path. ' or this from google search add double quotes. 's = String.Format("{0}c:\Users\public\public documents{1}", Chr(34), Chr(34)) ' Error - Illegal chars in path files = Directory.GetDirectories(s) What am i doing wrong? Thanks
speedbump99 wrote:
s = "c:\Users\public\public documents" ' Error - Could not find part of the path.
"C:\Users\Public\Documents" Not "public documents" onder "public", that's redundant.
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^] "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.