I have a variable define as:
set filePath=".\file.txt"
I’m writing a windows batch file. Need to convert the path stored in variable ‘filePath’ to its fullpath (physical path).
How can I get the full path of this path? Please help!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Since your question is tagged “command-line” I assume you want to do this in a Windows bat script. There you can expand a variable to the full path using the following syntax:
where I is the name of the variable.
The following script will print you the full path to “.\file.txt”:
A full reference of available substitutions is contained in the description of the
forcommand (http://technet.microsoft.com/en-us/library/bb490909.aspx).