Incorrect syntax in adventure works install script via SMSS
It looks like you are running the script from an SSMS window and it contains SQLCMD variables. Enable SQLCMD mode from the Query menu (Query-->SQLCMD Mode). Be sure the SQLCMD variable values are set as desired before running the script.