批處理指令碼 - DEL



此批處理命令刪除檔案,而不刪除目錄。

句法

del [filename]

示例

以下示例顯示了 del 命令的不同變體。

@echo off 
Rem Deletes the file lists.txt in C:\ 
del C:\lists.txt 
Rem Deletes all files recursively in all nested directories
del /s *.txt 
Rem Deletes all files recursively in all nested directories , but asks for the 
confirmation from the user first 
Del /p /s *.txt

輸出

所有操作都按照批處理檔案中的備註執行。

batch_script_commands.htm
廣告