Windows equivalent of 'touch' (i.e. the node.js way to create an index.html)

后端 未结 19 2332
一整个雨季
一整个雨季 2020-11-28 00:47

On a windows machine I get this error

\'touch\' is not recognized as an internal or external command, operable program or batch file.

19条回答
  •  无人及你
    2020-11-28 01:28

    The answer is wrong, it only works when the file does not exist. If the file exists, using the first does nothing, the second adds a line at the end of the file.

    The correct answer is:

    copy /b filename.ext +,,
    

    I found it here: https://superuser.com/questions/10426/windows-equivalent-of-the-linux-command-touch/764721#764721

提交回复
热议问题