Here is an explanation of the difference between a relative and an absolute path, with an example for Windows 11, 10, ... an MS Server OS!
For example, the absolute path is 1
In the example above, the absolute path contains the full path to the file and not just the file that is displayed in the non-absolute path.
My working directory 1 is:
If you are in one of these folders in this example, then:
The relative path to the absolute path is 1
The working directory 1 + relative path result in the absolute path
"C:\Folder1\" & "Folder2\file.txt" = C:\Folder1\Folder2\ fileii1.txt
You can always use the absolute path to open a file
My working directory 2 is:
The relative path to the absolute path 1
With ".." you negate the folder3, or change one level higher and you have the correct absolute path again
These rules also apply in the Windows command line
The Windows command line can be used to determine the absolute path of any file by looking at the current directory.
If you, for example, C:\Windows\Systwm32\ are (cd = change directory)
In other words, the absolute path is the full directory path and file name.
FAQ 103: Updated on: 27 July 2021 17:55