Batch File Deletes all directories under the folder and itself

Updated on technology 2024-04-09
3 answers
  1. Anonymous users2024-02-07

    1. Create a new folder on the computer, create a new "txt" file, and name it.

    2. Right-click and set the file suffix to ".".bat。

    3. Create a new folder and file as an example listed.

    4. Right-click to open the file, and enter "del q a f c: users administrator desktop to create a new folder a *."as a command line.

    5. Enter "pause" in the second line as the command to pause the display.

    6. After saving, double-click the bat file to delete all files in the target path.

  2. Anonymous users2024-02-06

    1. Write a BAT batch file. Among them, rem can be removed, and it is kept here to facilitate the execution effect.

    2. Then, drag and drop the text file that contains the files you want to delete onto the batch file, and the batch will run and delete all the files listed in it successfully.

    3. The following is an introduction to a key point. First, we use the "%1" system variable, which gets the full path to the drag-and-drop file.

    4. Then type %1 is to output the content of the text file into a string for the use of the for f command.

    5. In addition, "Cong Fanchang tokens=1*" is used in batch processing, mainly to investigate that some file paths contain space, and the file path can be completely obtained with the "%%i %%j" infiltration behind.

    6. At the same time, use double quotation marks to enclose %%i %%j in the command to ensure that the del command can correctly identify the file name with spaces, otherwise it will report the error that the file cannot be found.

    7. If the batch process reads the file path, the middle car in the path is garbled, then you can save the txt file and make sure that the encoding is selected "asni".

  3. Anonymous users2024-02-05

    The dos command is easy to delete all files in a folder. There's not even a need for batch processing. x0d x0a, but the batch of dos commands cannot be "regular".

    bat or. cmd file. x0d x0a3, use Scheduled Tasks in the Control Panel to set a time to run this batch file.

    The cmd file is placed in the "Startup" item in the start menu. This way, it will be executed every time the device is turned on.

Related questions
8 answers2024-04-09

echo off

taskkill /f /t /im >>>More

10 answers2024-04-09

attrib c: windows system32 +h, pay attention to the spaces. >>>More

19 answers2024-04-09

echo off

del C: Windows System32 adds this batch to the startup of the menu. >>>More

10 answers2024-04-09

First, open your D drive first.

Fourth, on the top of the file right - rename. >>>More

7 answers2024-04-09

The materials we need to prepare are: computer, folder or file to be deleted. >>>More