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. C#
  4. System.IO.Directory.Exists with drive as parameter doesn't work in Vista (?)

System.IO.Directory.Exists with drive as parameter doesn't work in Vista (?)

Scheduled Pinned Locked Moved C#
csharpquestion
3 Posts 3 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.
  • E Offline
    E Offline
    ea3 lf
    wrote on last edited by
    #1

    Hi, We have a program, made with C#: that's why I am here :-). In order to check for a drive existence, we use System.IO.Directory.Exists, giving the drive letter and root folder as parameters (i. e., "C:\\"). Under Windows XP it runs just fine, but under Windows Vista, the call always return false, even against C:\. Could anybody give us any advice about it...? It's driving us nuts!! :confused: Fidel Leon - EA3LF

    J D 2 Replies Last reply
    0
    • E ea3 lf

      Hi, We have a program, made with C#: that's why I am here :-). In order to check for a drive existence, we use System.IO.Directory.Exists, giving the drive letter and root folder as parameters (i. e., "C:\\"). Under Windows XP it runs just fine, but under Windows Vista, the call always return false, even against C:\. Could anybody give us any advice about it...? It's driving us nuts!! :confused: Fidel Leon - EA3LF

      J Offline
      J Offline
      joon vh
      wrote on last edited by
      #2

      Im sorry, I downgraded back to Vista (because it wasn't worth it imo on a <3000$ laptop) but I can confirm that it works on XP.


      Visual Studio can't evaluate this, can you? public object moo { __get { return moo; } __set { moo = value; } }

      1 Reply Last reply
      0
      • E ea3 lf

        Hi, We have a program, made with C#: that's why I am here :-). In order to check for a drive existence, we use System.IO.Directory.Exists, giving the drive letter and root folder as parameters (i. e., "C:\\"). Under Windows XP it runs just fine, but under Windows Vista, the call always return false, even against C:\. Could anybody give us any advice about it...? It's driving us nuts!! :confused: Fidel Leon - EA3LF

        D Offline
        D Offline
        Douglas Troy
        wrote on last edited by
        #3

        Well, being Windows Vista, you probably need to set the IO security rights before it will let you read/check/validate or anything else ... Have a look-see at this topic: FileIOPermission[^]


        :..::. Douglas H. Troy ::..
        Bad Astronomy |VCF|wxWidgets|WTL

        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