Extract base path to variable