Home  >  Article  >  System Tutorial  >  Basic operation method of deleting files in WIN7 batch process

Basic operation method of deleting files in WIN7 batch process

WBOY
WBOYforward
2024-04-24 11:07:26698browse

Want to use batch commands to delete files in WIN7 system, but don’t know how to do it? Don't worry, PHP editor Xinyi will explain in detail the basic operation process of deleting files in WIN7 batch process. This tutorial will guide you step by step on how to use batch commands to effectively delete specified directories or files. Continue reading the following content to learn how to skillfully operate batch deletion of files in WIN7 system.

Right-click to open the right-click menu and create a new text document.

Basic operation method of deleting files in WIN7 batch process

Change the .txt suffix of the text document to .cmd or .bat, for example, change [New Text Document.txt] to [test.bat].

Basic operation method of deleting files in WIN7 batch process

Click OK in the pop-up dialog box.

Basic operation method of deleting files in WIN7 batch process

Right-click test.bat and click Edit in the pop-up menu.

Basic operation method of deleting files in WIN7 batch process

Then enter the following command (for example, to delete all txt files in the folder).

@echo on

for /r %%f in (*.htm) do del %%f

Ctrl S to save; as shown in the picture:

Basic operation method of deleting files in WIN7 batch process

Copy the test.bat file to the folder you want to process.

Basic operation method of deleting files in WIN7 batch process

After double-clicking the test.bat file, all txt files in this folder were deleted.

Basic operation method of deleting files in WIN7 batch process

The above is the detailed content of Basic operation method of deleting files in WIN7 batch process. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:zol.com.cn. If there is any infringement, please contact admin@php.cn delete