Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Cannot get directory list. Thanks for the info. Message Closed.

Cannot get directory list. Thanks for the info. Message Closed.

Scheduled Pinned Locked Moved Visual Basic
helpquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mo1492
    wrote on last edited by
    #1

    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

    L 2 Replies Last reply
    0
    • M mo1492

      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

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Quote:

      What am i doing wrong?

      Nothing. Explorer uses various link names as aliases to real directories. What you have is correct.

      1 Reply Last reply
      0
      • M mo1492

        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

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups