A number of characters are not allowed in the folder names and file names.
Invalid characters include all control characters such as tab, linefeed, etc (values 1-31), the null character (value 0), and these symbols:
< > " \ / | * ?
In addition, the folder and file name cannot end with a period or space.
String Length Limitations
The entire drive, path and file name combination cannot normally exceed 260 characters in length, although Windows can support up to 32,767 character when the path string is prefixed with "\\?\" the long path indicator. It is less clear that third-party applications will reliably support this, so it's best to avoid it if possible.
For example: \\?\d:\folder\my long path-filename here
The CD/DVD file system standards are even more limited and depending on the file system, may limit you to 64 or 128 character file names.