I personally tested this to make a script + external VBS script portable, aka I wanted the VBS path inside the CMD to be "relative" (same directory). It would likely work for other purposes.
Just add this to the top of the CMD:
pushd %~dp0
Then use this in CMD to call file in CD:
"%~dp0File.txt"