2

So I'm trying to use XP_CMDSHELL to set up my drive for using a backup. I already have the drive mapped, but per Link, I figured I'd need to mount the drive using net use.

But when I do, I get System error 53, 'The network path was not found.'

EXEC XP_CMDSHELL 'net use S: \\sql-backup'

I know this unc is accessible from the server because it is mounted as a network share on the sql server.

Any ideas why the unc is unreachable?

Glorfindel
2,2095 gold badges19 silver badges26 bronze badges
asked Apr 14, 2012 at 0:13
2
  • 1
    Why don't you just backup straight to the UNC path, use that in your backup command, in place of mapping it? Commented Apr 14, 2012 at 3:03
  • 1
    +1 Shawn. There's no reason to use xp_cmdshell for this. Honestly, with all the tools available (CLRs, SSIS, the ability to invoke the command shell via the agent, Powershell...), there's really no legitimate reason to use xp_cmdshell. xp_cmdshell was a good "pre SQL 2005" tool that, for security reasons, most experts now recommend disabling. Commented Aug 19, 2012 at 18:57

2 Answers 2

2

You have to give it both the server name and a shared folder, i.e., \\Server\SharedFolder.

answered Jul 20, 2012 at 17:13
0

An idea would be to check to see if the account identity for the SQL Service has access to that network share.

answered Apr 21, 2012 at 3:32

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.