Posted By

pollusb on 03/10/09


backup connection admin

Versions (?)

Connect SQL Server to a Windows Shared Folder

 / Published in: SQL

This is how you can connect SQL Server to a Share folder for your backups. After running this, you will see the letter T: in the GUI. Each line must be run seperatly.

  1. exec xp_cmdshell 'NET USE'-- to list the mapped drives
  2. exec xp_cmdshell 'NET USE T: \\\share /user:\pollusb password' --to connect
  3. exec xp_cmdshell 'DIR T:\ /b'
  4. exec xp_cmdshell 'NET USE T: /D' -- to remove the share
  5. -- Note : you can also make the connection permanent by using /PERSISTENT:YES
  6. -- More info on NET USE /? on CMD

Report this snippet  

You need to login to post a comment.