Not sure if it will fit to SQL Server 2005 as I use 2017 Express on my laptop,
but give it a try...
USE [master]
GO
EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'SoftwareMicrosoftMSSQLServerMSSQLServer', N'DefaultData', REG_SZ, N'C:DATA'
GO
EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'SoftwareMicrosoftMSSQLServerMSSQLServer', N'DefaultLog', REG_SZ, N'C:DATA'
GO
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…