I have produced a script of the database in SQL Server 2008. The produced script has got the hardcoded path of in which the database could be produced. I do not this road to be hardcoded, I would like this road to default from the database engine the script is running on or some like this.

This is actually the small area of the script:

CREATE DATABASE [POS] ON  PRIMARY 
( NAME = N'POS', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS\MSSQL\DATA\POS.mdf' , SIZE = 2048KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
 LOG ON 
( NAME = N'POS_log', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS\MSSQL\DATA\POS_log.ldf' , SIZE = 1024KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
GO

The road C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS\MSSQL\DATA\POS.mdf may not exist on all computer systems this is exactly why I would like it to be selected by database engine

Simply produce the database after which adjust all of the needed qualities directly in files

CREATE DATABASE [POS] 
GO
ALTER DATABASE POS MODIFY FILE 
( NAME = N'POS' , SIZE = 3048KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
GO
ALTER DATABASE POS MODIFY FILE 
( NAME = N'POS_log' , SIZE = 1024KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
GO

How about we use just:

CREATE DATABASE [POS];

This can produce the database with the default configurations (including pathways). You might alter any setting you want afterwards.