<name> is not a valid file name.

This error occurs when you attempt to create a new file from the Command window, but include unsupported characters in the file name.

File names cannot contain the following characters:

  • pound (#)

  • percent (%)

  • ampersand (&)

  • asterisk (*)

  • vertical bar (|)

  • backslash (\)

  • colon (:)

  • double quotation mark (")

  • less than (<)

  • greater than (>)

  • period (.)

  • question mark (?)

  • forward slash (/)

  • leading or trailing spaces (' ')

  • names reserved for Windows or DOS (nul, aux, con, com1, lpt1, and so on)

To correct this error

  • Enter the command with a new file name that does not contain the characters listed above.

See Also

Reference

New File Command

Visual Studio Commands with Arguments