Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to map another server by giving the command

EXEC xp_cmdshell 'NET USE H:\568.256.8.358\backup_147 1234abc /USER:cranew /PERSISTENT:yes'

I got an error with this network path not found

But I am able to map another server manually.

Please do help me in sorting out this.

share|improve this question
Hello, to avoid being flagged down or having your question deleted by the mods, please provide more information. How are you trying to connect to another server by using SQL Server Management Studio exactly? Are you using powershell? XP_CMDSHELL? Your NET USE command is totally wrong as well. I don't see how that would work anywhere, inside or outside of SQL Server. You need 2 backslashes (\) and a folder for it to work. – Ali Razeghi Oct 25 '12 at 5:30
Sorry, last comment didn't fully save. Is there a typo in the net use statement? I'd expect something like: NET USE H:\ \\server\share 1234abc /USER:cranew /PERSISTENT:yes – Stuart Moore Oct 25 '12 at 6:53

This is more of a NET USE question than a SSMS/SQL Server question.

NET USE has the syntax:

net use [{DeviceName | *}] [\\ComputerName\ShareName[\volume]] [{Password | *}]] [/user:[DomainName]UserName] [/user:[DottedDomainName]UserName] [/user: [UserName@DottedDomainName] [/savecred] [/smartcard] [{/delete | /persistent:{yes | no}}]

So I expect your command to look like this:

EXEC xp_cmdshell 'NET USE H: \\568.256.8.358\backup_147 1234abc /USER:cranew /PERSISTENT:yes'
share|improve this answer

Don't map network drives and expect them to be there. Just backup to the network path directly.

Using mapped drives gets tricky fast as you start to make assumptions that the drive letter will be available next time. What happens when you add another hard drive to the server later and want to use that drive letter? What happens when Windows disconnects the drive to reclaim the network socket?

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.