Finding the SQL Server Instance Default Path and the Instance Default Log Path in the old days (pre SQL Server 2012) was generally limited to either checking SSMS for the Instance Default Path or Log Path , and you could also use xp_regread to extract the information from the Registry.

For the last few versions of SQL Server similar information can be extracted using the SERVERPROPERTY functionality. This has introduced the benefit of being able to programmatically extract the details and include the code as part of other DBA scripts used to manage SQL Server.

An example of using the SERVERPROPERTY('InstanceDefaultPath') and SERVERPROPERTY('InstanceDefaultLogPath') :

Typically this information is used to discover the target path of the data and log file when the CREATE DATABASE is executed. If no paths are detailed in the CREATE DATABASE statement - SQL Server will place the files on the Default Data and Log files.