Here are three targets that are helpful.
WhereAmI is the one I use when trying to figure out my current directory of course.
The others are informative as well (some are beyond the scope of the question).
<Target Name="WhereAmI">
<Message Text=" Here I Am " />
<Exec Command="dir ." />
<Message Text=" " />
</Target>
<Target Name="ShowReservedProperties" AfterTargets="BeforeBuild">
<Message Text=" MSBuildProjectDirectory = $(MSBuildProjectDirectory)" Importance="high" />
<Message Text=" MSBuildProjectFile = $(MSBuildProjectFile)" Importance="high" />
<Message Text=" MSBuildProjectExtension = $(MSBuildProjectExtension)" Importance="high" />
<Message Text=" MSBuildProjectFullPath = $(MSBuildProjectFullPath)" Importance="high" />
<Message Text=" MSBuildProjectName = $(MSBuildProjectName)" Importance="high" />
<Message Text=" MSBuildBinPath = $(MSBuildBinPath)" Importance="high" />
<Message Text=" MSBuildProjectDefaultTargets = $(MSBuildProjectDefaultTargets)" Importance="high" />
<Message Text=" MSBuildExtensionsPath = $(MSBuildExtensionsPath)" Importance="high" />
<Message Text=" MSBuildStartupDirectory = $(MSBuildStartupDirectory)" Importance="high"/>
</Target>
<Target Name="ShowOtherProperties">
<Message Text=" " />
<Message Text=" " />
<Message Text=" Environment (SET) Variables* " />
<Message Text=" --------------------------- " />
<Message Text=" COMPUTERNAME = *$(COMPUTERNAME)* " />
<Message Text=" USERDNSDOMAIN = *$(USERDNSDOMAIN)* " />
<Message Text=" USERDOMAIN = *$(USERDOMAIN)* " />
<Message Text=" USERNAME = *$(USERNAME)* " />
</Target>
If you're using an "external MSBuild file" and need to pass a filename or path to it (because external MSBuild files do not like relative files if they are not in the same directory as the calling .msbuild file)....here is a convenient (3.5 and up I believe) Task.
<ConvertToAbsolutePath Paths="..\"> <!-- Some relative path here -->
<Output TaskParameter="AbsolutePaths" PropertyName="MyAbsolutionPathProperty"/>
</ConvertToAbsolutePath>
<Message Text="'MyAbsolutionPathProperty' = '$(MyAbsolutionPathProperty)'" />