Is there a way in a Windows batch script to return an absolute path from a value containing a filename and/or relative path?
Given:
"..\"
"..\somefile.txt"
I need the absolute path relative to the batch file.
Example:
- "somefile.txt" is located in "C:\Foo\"
- "test.bat" is located in "C:\Foo\Bar".
- User opens a command window in "C:\Foo" and calls
Bar\test.bat ..\somefile.txt - In the batch file "C:\Foo\somefile.txt" would be derived from
%1