Windows的cmd建立空檔案的方式如下。
範例環境:
- Windows 11
輸入type nul > [FILENAME];即可,[FILENAME]為要建立的檔案名稱及副檔名,忽略出現的錯誤訊息。
例如要建立一個空的檔案名稱為"afile",則輸入type nul > afile。
> type nul > afile
type : Cannot find path 'C:\nul' because it does not exist.
At line:1 char:1
+ type nul > afile
+ ~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (C:\nul:String) [Get-Content], ItemNotF
oundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand
2 則留言:
截圖中看起來是使用 Powershell,而不是 cmd
我是用cmd沒錯喔,剛確認了一下
張貼留言