Directory.CreateDirectory() throwing DirectoryNotFound exception for //server/share path

Discussion in 'ASP .Net Web Services' started by Dan, Jul 23, 2004.

  1. Dan

    Dan Guest

    Hello,

    I am creating an ASP.NET web service with VB, and I need to be able to
    create a directory on a network share. When I attempt to create the
    directory (\\server\share\test), I receive the DirectoryNotFound
    exception, stating "Could not find part of the path '\\server\share'."
    I have also found that when I create the "test" folder in that
    network share, and run Directory.Exists("\\server\share\test"), it
    returns false.

    All of the code works fine when dealing with local paths (such as
    "C:\test"). I have verified that the account the web service is
    running as has all the necessary permissions.

    Any ideas?

    Here is the actual code that throws the exception: (strFilePath =
    "\\server\share\test")

    If Not Directory.Exists(strFilePath) Then
    Directory.CreateDirectory(strFilePath)
    ....

    Thank you!
    Dan, Jul 23, 2004
    #1
    1. Advertising

  2. Dan

    Max Guest

    What are the security permissions of \\server\share and of the underlying
    directory on the server?
    What permission does your code have?
    Does it use Internet Guest Account (IUSR_<ComputerName>)?


    "Dan" <> wrote in message
    news:...
    > Hello,
    >
    > I am creating an ASP.NET web service with VB, and I need to be able to
    > create a directory on a network share. When I attempt to create the
    > directory (\\server\share\test), I receive the DirectoryNotFound
    > exception, stating "Could not find part of the path '\\server\share'."
    > I have also found that when I create the "test" folder in that
    > network share, and run Directory.Exists("\\server\share\test"), it
    > returns false.
    >
    > All of the code works fine when dealing with local paths (such as
    > "C:\test"). I have verified that the account the web service is
    > running as has all the necessary permissions.
    >
    > Any ideas?
    >
    > Here is the actual code that throws the exception: (strFilePath =
    > "\\server\share\test")
    >
    > If Not Directory.Exists(strFilePath) Then
    > Directory.CreateDirectory(strFilePath)
    > ...
    >
    > Thank you!
    Max, Jul 26, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. GM
    Replies:
    2
    Views:
    2,209
  2. =?Utf-8?B?Q2xpbnRvbiBGcmFua2xhbmQ=?=

    CreateDirectory() - Could not find a part of the path "D:\".

    =?Utf-8?B?Q2xpbnRvbiBGcmFua2xhbmQ=?=, Apr 5, 2005, in forum: ASP .Net
    Replies:
    9
    Views:
    9,493
    john_crim
    Jun 6, 2005
  3. Andrew R. Jones
    Replies:
    2
    Views:
    3,537
    Andrew R. Jones
    Jan 5, 2006
  4. Matt MacDonald
    Replies:
    0
    Views:
    389
    Matt MacDonald
    Jan 30, 2008
  5. Saraswati lakki
    Replies:
    0
    Views:
    1,287
    Saraswati lakki
    Jan 6, 2012
Loading...

Share This Page