Make filename with colon (“:”) in Windows

2019-09-10 08:12发布

问题:

I created the file its name is 'asdf:qwer'.

'asdf' file was created, and I input some words.

'asdf' capacity is 0, Hex has no contents.

But I can get words.

  1. Where they come from?

  2. What is colon(:)'s functions in Windows shell?

回答1:

Colon is not an allowed character in a filename in Windows. Or, more precisely, it is used to address an Alternate Data Stream of a file. So, asdf:qwer addresses the stream named qwer of the file named asdf.

This is very similar to the backslash. asdf\qwer is also not a valid filename, instead it addresses the file qwer of the folder asdf.