By default, MS-DOS and Microsoft Windows command line will not prompt the user or give the user a prompt or warning when deleting files on the computer with the del command. However, when trying to delete a directory using the del, deltree, or rmdir command, make sure it’s not empty, or you’ll get a warning or error.

Xoa file trong MS-DOS

Note: When deleting anything from MS-DOS or the Windows command line, it will not be sent to the Recycle Bin.

Deltree command

To stop prompting, use the deltree command and add the / y tag, as in the example below, to delete all the files in the Windows temp folder.

 deltree c:  windows  temp  *. * / y

Note: The above command does not work in all versions of Windows and MS-DOS.

If this command doesn’t work, we recommend creating a batch file with the below command in the batch file.

 echo y | del% 1  *. *

Once created, you can enter the batch file name, followed by the folder you want to delete.

The Rd and rmdir commands

Users who want to delete a folder containing files in a Windows command line window running under Microsoft Windows 2000 or later can also use the rmdir or rd command with the S option.

Delete an order

If you are running a newer version of Microsoft Windows and using the Windows command line, you can also use the delete command to delete the file without prompting.