MSSQL Default Backup Location

Default backup location

-- Query location
EXECUTE [master].dbo.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'SOFTWAREMicrosoftMSSQLServerMSSQLServer', N'BackupDirectory'
-- Set location
EXECUTE [master].dbo.xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'SOFTWAREMicrosoftMSSQLServerMSSQLServer', N'BackupDirectory','REG_SZ', 'SERVERNAMESHARENAMEFOLDERNAME'

The same can be done using Regedit Local Machine > Software > Microsoft > Microsoft SQL Server > ‘INSTANCENAME’ > MSSQLServer Key = BackupDirectory

Posted in Databases, Databases with : SQL Server