how to create fil in cmd code example Example 1: how to create empty file cmd windows copy NUL test.txt Example 2: create file and write to it cmd echo some-text > filename.txt