Which characters are invalid for MS-DOS filenames?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












I'm writing a filename i/o procedure in x86-16 assembly language. It takes 8 characters (I don't need to support long filenames) from the keyboard and prints them to the screen into a text input field.



At the moment, i'm allowing numbers, upper/lower case letters, underscore, and hyphens. I'd like to allow all symbols that won't cause issues with MS-DOS. I couldn't find an official list of banned characters, except that '.' shouldn't be a leading character. Common sense tells me that slashes are illegal, but '+' should be okay, but I don't know for sure.



I'm already ignoring '.' because ".REG" is automatically appended to the end of the file name before control is passed to MS-DOS file services.










share|improve this question







New contributor




My life is a bug. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.























    up vote
    1
    down vote

    favorite












    I'm writing a filename i/o procedure in x86-16 assembly language. It takes 8 characters (I don't need to support long filenames) from the keyboard and prints them to the screen into a text input field.



    At the moment, i'm allowing numbers, upper/lower case letters, underscore, and hyphens. I'd like to allow all symbols that won't cause issues with MS-DOS. I couldn't find an official list of banned characters, except that '.' shouldn't be a leading character. Common sense tells me that slashes are illegal, but '+' should be okay, but I don't know for sure.



    I'm already ignoring '.' because ".REG" is automatically appended to the end of the file name before control is passed to MS-DOS file services.










    share|improve this question







    New contributor




    My life is a bug. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.





















      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I'm writing a filename i/o procedure in x86-16 assembly language. It takes 8 characters (I don't need to support long filenames) from the keyboard and prints them to the screen into a text input field.



      At the moment, i'm allowing numbers, upper/lower case letters, underscore, and hyphens. I'd like to allow all symbols that won't cause issues with MS-DOS. I couldn't find an official list of banned characters, except that '.' shouldn't be a leading character. Common sense tells me that slashes are illegal, but '+' should be okay, but I don't know for sure.



      I'm already ignoring '.' because ".REG" is automatically appended to the end of the file name before control is passed to MS-DOS file services.










      share|improve this question







      New contributor




      My life is a bug. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      I'm writing a filename i/o procedure in x86-16 assembly language. It takes 8 characters (I don't need to support long filenames) from the keyboard and prints them to the screen into a text input field.



      At the moment, i'm allowing numbers, upper/lower case letters, underscore, and hyphens. I'd like to allow all symbols that won't cause issues with MS-DOS. I couldn't find an official list of banned characters, except that '.' shouldn't be a leading character. Common sense tells me that slashes are illegal, but '+' should be okay, but I don't know for sure.



      I'm already ignoring '.' because ".REG" is automatically appended to the end of the file name before control is passed to MS-DOS file services.







      filenames ms-dos






      share|improve this question







      New contributor




      My life is a bug. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question







      New contributor




      My life is a bug. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question






      New contributor




      My life is a bug. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 1 hour ago









      My life is a bug.

      1185




      1185




      New contributor




      My life is a bug. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      My life is a bug. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      My life is a bug. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          4
          down vote



          accepted










          According to wikipedia




          Legal characters for DOS filenames include the following:



          • Upper case letters A–Z

          • Numbers 0–9

          • Space (though trailing spaces in either the base name or the extension are considered to be padding and not a part of the filename, also filenames with spaces in them must be enclosed in quotes to be used on a DOS command line, and if the DOS command is built programatically, the filename must be enclosed in quadruple quotes when viewed as a variable within the program building the DOS command.)

          • ! # $ % & ' ( ) - @ ^ _ ` ~

          • Values 128–255 (though if NLS services are active in DOS, some characters interpreted as lowercase are invalid and unavailable)

          This excludes the following ASCII characters:




          • " * + , / : ; < = > ? [ ] | [9]

          • Windows/MS-DOS has no shell escape character


          • . (U+002E . full stop) within name and extension fields, except in . and .. entries (see below)

          • Lower case letters a–z (stored as A–Z on FAT12/FAT16)

          • Control characters 0–31

          • Value 127 (DEL)[dubious – discuss]



          https://en.wikipedia.org/wiki/8.3_filename#Directory_table






          share|improve this answer



























            up vote
            1
            down vote













            Found this in a manual for MS-DOS 3.3, i'm running 6.22, but it probably still applies.
            I was wrong about '+' being allowed.



            enter image description here






            share|improve this answer








            New contributor




            My life is a bug. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.

















              Your Answer







              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "3"
              ;
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function()
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled)
              StackExchange.using("snippets", function()
              createEditor();
              );

              else
              createEditor();

              );

              function createEditor()
              StackExchange.prepareEditor(
              heartbeatType: 'answer',
              convertImagesToLinks: true,
              noModals: false,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );






              My life is a bug. is a new contributor. Be nice, and check out our Code of Conduct.









               

              draft saved


              draft discarded


















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1362080%2fwhich-characters-are-invalid-for-ms-dos-filenames%23new-answer', 'question_page');

              );

              Post as a guest






























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes








              up vote
              4
              down vote



              accepted










              According to wikipedia




              Legal characters for DOS filenames include the following:



              • Upper case letters A–Z

              • Numbers 0–9

              • Space (though trailing spaces in either the base name or the extension are considered to be padding and not a part of the filename, also filenames with spaces in them must be enclosed in quotes to be used on a DOS command line, and if the DOS command is built programatically, the filename must be enclosed in quadruple quotes when viewed as a variable within the program building the DOS command.)

              • ! # $ % & ' ( ) - @ ^ _ ` ~

              • Values 128–255 (though if NLS services are active in DOS, some characters interpreted as lowercase are invalid and unavailable)

              This excludes the following ASCII characters:




              • " * + , / : ; < = > ? [ ] | [9]

              • Windows/MS-DOS has no shell escape character


              • . (U+002E . full stop) within name and extension fields, except in . and .. entries (see below)

              • Lower case letters a–z (stored as A–Z on FAT12/FAT16)

              • Control characters 0–31

              • Value 127 (DEL)[dubious – discuss]



              https://en.wikipedia.org/wiki/8.3_filename#Directory_table






              share|improve this answer
























                up vote
                4
                down vote



                accepted










                According to wikipedia




                Legal characters for DOS filenames include the following:



                • Upper case letters A–Z

                • Numbers 0–9

                • Space (though trailing spaces in either the base name or the extension are considered to be padding and not a part of the filename, also filenames with spaces in them must be enclosed in quotes to be used on a DOS command line, and if the DOS command is built programatically, the filename must be enclosed in quadruple quotes when viewed as a variable within the program building the DOS command.)

                • ! # $ % & ' ( ) - @ ^ _ ` ~

                • Values 128–255 (though if NLS services are active in DOS, some characters interpreted as lowercase are invalid and unavailable)

                This excludes the following ASCII characters:




                • " * + , / : ; < = > ? [ ] | [9]

                • Windows/MS-DOS has no shell escape character


                • . (U+002E . full stop) within name and extension fields, except in . and .. entries (see below)

                • Lower case letters a–z (stored as A–Z on FAT12/FAT16)

                • Control characters 0–31

                • Value 127 (DEL)[dubious – discuss]



                https://en.wikipedia.org/wiki/8.3_filename#Directory_table






                share|improve this answer






















                  up vote
                  4
                  down vote



                  accepted







                  up vote
                  4
                  down vote



                  accepted






                  According to wikipedia




                  Legal characters for DOS filenames include the following:



                  • Upper case letters A–Z

                  • Numbers 0–9

                  • Space (though trailing spaces in either the base name or the extension are considered to be padding and not a part of the filename, also filenames with spaces in them must be enclosed in quotes to be used on a DOS command line, and if the DOS command is built programatically, the filename must be enclosed in quadruple quotes when viewed as a variable within the program building the DOS command.)

                  • ! # $ % & ' ( ) - @ ^ _ ` ~

                  • Values 128–255 (though if NLS services are active in DOS, some characters interpreted as lowercase are invalid and unavailable)

                  This excludes the following ASCII characters:




                  • " * + , / : ; < = > ? [ ] | [9]

                  • Windows/MS-DOS has no shell escape character


                  • . (U+002E . full stop) within name and extension fields, except in . and .. entries (see below)

                  • Lower case letters a–z (stored as A–Z on FAT12/FAT16)

                  • Control characters 0–31

                  • Value 127 (DEL)[dubious – discuss]



                  https://en.wikipedia.org/wiki/8.3_filename#Directory_table






                  share|improve this answer












                  According to wikipedia




                  Legal characters for DOS filenames include the following:



                  • Upper case letters A–Z

                  • Numbers 0–9

                  • Space (though trailing spaces in either the base name or the extension are considered to be padding and not a part of the filename, also filenames with spaces in them must be enclosed in quotes to be used on a DOS command line, and if the DOS command is built programatically, the filename must be enclosed in quadruple quotes when viewed as a variable within the program building the DOS command.)

                  • ! # $ % & ' ( ) - @ ^ _ ` ~

                  • Values 128–255 (though if NLS services are active in DOS, some characters interpreted as lowercase are invalid and unavailable)

                  This excludes the following ASCII characters:




                  • " * + , / : ; < = > ? [ ] | [9]

                  • Windows/MS-DOS has no shell escape character


                  • . (U+002E . full stop) within name and extension fields, except in . and .. entries (see below)

                  • Lower case letters a–z (stored as A–Z on FAT12/FAT16)

                  • Control characters 0–31

                  • Value 127 (DEL)[dubious – discuss]



                  https://en.wikipedia.org/wiki/8.3_filename#Directory_table







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 39 mins ago









                  phuclv

                  8,01643385




                  8,01643385






















                      up vote
                      1
                      down vote













                      Found this in a manual for MS-DOS 3.3, i'm running 6.22, but it probably still applies.
                      I was wrong about '+' being allowed.



                      enter image description here






                      share|improve this answer








                      New contributor




                      My life is a bug. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.





















                        up vote
                        1
                        down vote













                        Found this in a manual for MS-DOS 3.3, i'm running 6.22, but it probably still applies.
                        I was wrong about '+' being allowed.



                        enter image description here






                        share|improve this answer








                        New contributor




                        My life is a bug. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                        Check out our Code of Conduct.



















                          up vote
                          1
                          down vote










                          up vote
                          1
                          down vote









                          Found this in a manual for MS-DOS 3.3, i'm running 6.22, but it probably still applies.
                          I was wrong about '+' being allowed.



                          enter image description here






                          share|improve this answer








                          New contributor




                          My life is a bug. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.









                          Found this in a manual for MS-DOS 3.3, i'm running 6.22, but it probably still applies.
                          I was wrong about '+' being allowed.



                          enter image description here







                          share|improve this answer








                          New contributor




                          My life is a bug. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.









                          share|improve this answer



                          share|improve this answer






                          New contributor




                          My life is a bug. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.









                          answered 59 mins ago









                          My life is a bug.

                          1185




                          1185




                          New contributor




                          My life is a bug. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.





                          New contributor





                          My life is a bug. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.






                          My life is a bug. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.




















                              My life is a bug. is a new contributor. Be nice, and check out our Code of Conduct.









                               

                              draft saved


                              draft discarded


















                              My life is a bug. is a new contributor. Be nice, and check out our Code of Conduct.












                              My life is a bug. is a new contributor. Be nice, and check out our Code of Conduct.











                              My life is a bug. is a new contributor. Be nice, and check out our Code of Conduct.













                               


                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1362080%2fwhich-characters-are-invalid-for-ms-dos-filenames%23new-answer', 'question_page');

                              );

                              Post as a guest













































































                              Comments

                              Popular posts from this blog

                              Long meetings (6-7 hours a day): Being “babysat” by supervisor

                              Is the Concept of Multiple Fantasy Races Scientifically Flawed? [closed]

                              Confectionery