• Try this key:

    Set@RegPath = 'SOFTWARE\Microsoft\Microsoft SQL Server\' + @SQLInstance + '\Setup'

    EXECmaster..xp_regread 'HKEY_LOCAL_MACHINE', @RegPath, 'SQLDataRoot', @value=@DataPath OUTPUT

    Wilfred
    The best things in life are the simple things