To run a file or a program from the command prompt it is necessary to indicate the exact path on the disk as otherwise it would not be found and therefore would not be executed. The path of a file or folder always begins with the name of the root directory or the letter of the memory drive in which it resides ( C: for example) followed by the other directories (folders and subfolders) under which it is located the actual file in question; all directory names of the path are separated by the backslash which is the backslash symbol.
It goes without saying that having to follow this order, obtaining and manually typing the path of a file or folder could be an impractical operation, especially if the directories that compose it are several, as well as requiring time and no typing errors.
This is why in these cases you need to paste the path to a folder or file into the command line or PowerShell. Now let’s see how to do it in Windows 11.
Steps to Copy Path of a File or a Folder in Windows 11
- You need to open the directory or file you want to copy the path of.
- Now, click on right-click on the file or folder.
- Select “Copy as Path” from the menu.
- Next, you can paste the path into PowerShell.