Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2003
    Posts
    223

    Unanswered: How to check the remote shared drive?

    Hello, everyone:

    I want to write a query to check a remote shared drive. The shared drive is mapped as T drive in my local. I run the statement,

    EXEC master.. xp_cmdshell 'DIR C:\'

    It works. If I change to T drive like,

    EXEC master.. xp_cmdshell 'DIR T:\'

    It dosen't work and returns,

    "The system cannot find the path specified."

    But I run DIR T:\ in DOS prompt, it works.

    Any help will be great appreciated.

    Thanks a lot.

    ZYT

  2. #2
    Join Date
    Dec 2002
    Posts
    1,245
    Quote Originally Posted by yitongzhang

    Thanks a lot.

    ZYT
    Did you try UNC? My brain is a little fuzzy and I don't have access to a remote server now (my two home servers are currently dead).

    Try:
    Code:
    Exec xp_cmdshell 'Dir \\MyServer\MyShare\'
    Be sure that the SQL Server Service account has permissions to read the remote share.

    Regards,

    hmscott
    Have you hugged your backup today?

  3. #3
    Join Date
    Mar 2003
    Posts
    223
    Scott:

    Thanks.

    I did, but got message,

    The network path was not found.

    How to assign the permissions to SQL Server?

    ZYT

  4. #4
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    the account the sql service is running under needs permission to that drive. right click on the folder on the destination machine and go to properties and check the permissions button under sharing and the security tab. Make sure the account is listed in those places.
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

  5. #5
    Join Date
    Nov 2006
    Location
    UK
    Posts
    46
    Hi
    You need to check the Services.
    Check which login is used by SQL Server ('SQL Server' service for SQL Server 2005 and 'MSSQL' for SQL Server 2000).
    Possibly your SQL Server service is running on Local System account.
    If you change it to any domain user account you can setup permissions to the network drive. Also you can map network drive (if you log on to the same account as a SQL Server service account).


    Regards
    Kris Zywczyk

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •