Wednesday, 4 April 2018

windows - How to create folder name or file name with special characters like / : * ? " |



My problem is that, I can not give name of my folder or file with special characters like \ / : * ? " < > | in windows based O.S. This is very important for me, that giving name of file/folder which contain this type of characters.


I already search and refer so many site,for this problems but all are hopeless. I also read Microsoft support page, they suggest use other characters. This is its link, https://support.microsoft.com/en-us/kb/177506


I already try Alt button + ASCII code number of this type of special characters, from numpad key, just example rename file/folder and press Alt+60 (for < characters) Still it giving message that, A filename cannot contain any of the following characters: \ / : * ? " < > |


Suggest me suitable solution so that I can give name of my file/folder with this type of special characters.



Answer



This is very important for me, naming of file/folder which contain these characters.


It may be important to you, but you will have to let this go and find a different way to solve your problem.


These characters are not allowed by the Windows OS function calls that handle filenames.


They are specifically not allowed because they have another use:



  • \ - Reserved for use as a path separator and escape character

  • / - Reserved for use as a path separator

  • : - Reserved for use as a drive name delimiter

  • * and ? - Reserved for use as wildcard characters

  • " - Reserved for use to quote names containing spaces

  • <, > and | - Reserved for use as command redirection operators


You can, of course, create files with names containing these characters using a different operating system (as long as that operating system can read/write a Windows file system).


However, you will be unable do do anything with those files using any Windows programs and they will not understand the file names and will generate errors.




Naming Files, Paths, and Namespaces



Naming Conventions


The following fundamental rules enable applications to create and process valid names for files and directories, regardless of the file system:


...


Use any character in the current code page for a name, including Unicode characters and characters in the extended character set (128–255), except for the following:




  • The following reserved characters:


    < (less than)
    > (greater than)
    : (colon)
    " (double quote)
    / (forward slash)
    \ (backslash)
    | (vertical bar or pipe)
    ? (question mark)
    * (asterisk)

  • Integer value zero, sometimes referred to as the ASCII NUL character.

  • Characters whose integer representations are in the range from 1 through 31, except for alternate data streams where these characters are allowed. For more information about file streams, see File Streams.

  • Any other character that the target file system does not allow.



Source Naming Files, Paths, and Namespaces




But I really want to do this anyway.


Install cygwin and use touch.


I haven't tested all the possibilities but the following work:


touch :
touch \|
touch \"
touch \>

Example output:


DavidPostill@Hal /f/test/impossible
$ ll
total 0
-rw-rw-rw-+ 1 DavidPostill None 0 Aug 10 21:03 '"'
-rw-rw-rw-+ 1 DavidPostill None 0 Aug 10 21:02 :
-rw-rw-rw-+ 1 DavidPostill None 0 Aug 10 21:02 '|'
-rw-rw-rw-+ 1 DavidPostill None 0 Aug 10 21:07 '>'

As you can see they are not usable in Windows:


F:\test\impossible>dir
Volume in drive F is Expansion
Volume Serial Number is 3656-BB63

Directory of F:\test\impossible

10/08/2016 21:07
.
10/08/2016 21:07
..
10/08/2016 21:03 0 
10/08/2016 21:02 0 
10/08/2016 21:07 0 
10/08/2016 21:02 0 
4 File(s) 0 bytes
2 Dir(s) 1,772,601,536,512 bytes free

enter image description here


No comments:

Post a Comment

Where does Skype save my contact&#39;s avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...