Others

How to Name Files with slash in Windows

The slash is a reserved character that is used as a separator in file paths. While it is not possible to use the slash character (/) in a file name on Windows, this post will show you the workaround.

Why we can’t use slash in the first place?

The slash character (/) is used in file paths to separate the different parts of the path, such as the drive letter, folders, and file name. For example, in the file path “C:/Users/Username/Documents/file.txt”

Windows uses the backslash character () as the default separator in file paths, but it also supports the forward slash (/) as an alternative. However, the forward slash is not used as the default separator because it can cause confusion with some programming languages that use the slash as an operator or delimiter.

how to name file with slash and special character in windows

The slash is used in this way because it is a symbol that is easy to type and is not often used in file names, making it a convenient choice for separating the different parts of a file path. Hence, a reserved character.

The Workaround

We can’t directly use slash, but technically, we can still use another character that “looks like” the slash.

Open Character Map in Start menu

The most suitable character for the slash is Division Slash (obviously it’s a mathematical character that looks like a slash) Click Select and Copy

Place the character in the file name and that’s it! You can use the same trick with other special character such as ? * < > as well.

The Catch

Since the character is not a slash, you can’t search the file with slash. You must use the division slash (or the character that you chose) to search for it. Also this can cause confusion if you working with other people who don’t know about this workaround.

That’s all for this tutorial. If you like it, check out our YouTube channel and our Facebook page to stay tune for more dev tips and tutorials

Written By

One comment

Leave a Reply

Your email address will not be published. Required fields are marked *

error: