Understanding File Paths

by Allen Wyatt
(last updated April 4, 2016)

2

You already know that information is stored on your disk drive in a series of files. You may also know that those files can be organized using folders, and that folders can exist within other folders. All this organization has a slight drawback, however—it can make locating a particular file a bit tricky.

This is where file paths come into play. A file path can be viewed as an address for your house; it provides detailed information (in a standardized format) for locating any given file on a disk drive. The file path starts with the drive letter of the disk drive, such as C:. To this beginning is appended the "path" of folders that are traversed to get to the file. Each item in the file path is separated from other items by a single backslash, in this manner:

c:\My Files\Budgets\Current Year\Research\budget.xlsx

This particular example shows that the file budget.xlsx (an Excel file) is stored within the Research folder, which in turn is stored in the Current Year folder, which is within the Budgets folder, which resides in the My Files folder.

Every path name—when fully qualified so it includes both the drive letter and the file name—is unique and unambiguous; there cannot be a duplicate path name for that unique file.

You should note that Windows places a limit on the length of path names—260 characters. This may seem like a lot of characters, but it is relatively easy to exceed. For example, the fully qualified path example earlier in this tip takes up 53 characters. With a few more subfolder "levels" added or a few more verbose folder names, the limit would be easy to reach. The rule here is to make sure that you name your folder and structure your hierarchy such that you lessen the risk of hitting this 260-character length limit.

 This tip (6818) applies to Windows 7, 8, and 10.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He  is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Copying Comments when Filtering

The advanced filtering feature in Excel allows you to quickly copy unique information from one data list to another. If you ...

Discover More

Using Tags with Document Files

Tags are a way for you to store keywords or metadata with your document files. They can be helpful when you are trying to ...

Discover More

Converting Numbers Into Words

Write out a check and you need to include the digits for the amount of the check and the value of the check written out in ...

Discover More
More WindowsTips

Making a File Read-Only

If you have an important file that you want to be sure doesn't get accidentally edited, you can set it to read-only. This tip ...

Discover More

Removing Locations from the Search Index

You can fine-tune Indexed Searches by removing locations from the search index. This tip tells you how.

Discover More

Checking the Archive Attribute with Robocopy

Robocopy can work on files according to each file's attributes. This tip shows you how to use Robocopy to only copy files ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WindowsTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 7 - 0?

2016-04-04 20:28:08

MWilson

To make it 'harder' to exceed the 260 character limit in a file path name I avoid Windows default file save locations -- they add longer file paths.

Our computers are all set up with a partitioned drive letter and the top folder named "~ Work" and everybody creates all their working and personal folders under that parent folder. Shortens the file name and provides concistent organization.

A related file name problem can occur when creating zipped files of a folder tree with many sub and sub-sub folders. Although that folder tree may have a short enough file name on your system, if the recipient of the zip file extracts it within several sub folders on their system that new location may exceed the file path name character count. When that happens it is frustrating to diagnose: the zipped file is there, but it won't open fully or display all the folders, if any at all.


2016-04-04 11:19:23

Hawkmeister

Good tip. Worthy of a longer write-up.

Failing to understand the ways of the path can lead to much confusion.

Not only 'losing' files (not knowing where they are) but also performance.

- some folks will name their folders / files with characters that may not parse well with some programs - # & are two examples.

- Also the %path% system variable if too long and containing redundant paths can slow the system down as it searches for programs to execute.


Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in WindowsTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.