D
D
Djasar2021-09-08 10:01:19
cmd/bat
Djasar, 2021-09-08 10:01:19

How to delete a file that is larger than the size?

There is a file. C:\Temp\disk.log Delete

through the batch file when the file size reaches 1 gigabyte.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Djasar, 2021-09-08
@Djasar

Well, he himself answered with a solution, and not with riddles.
set fldr=c:\temp
for /R %fldr% %%I In (disk.log) do if %%~zI GTR 1024000000 del /F /Q %%~I

R
res2001, 2021-09-08
@res2001

Check the size and delete.
You can get the file size using modifiers. See the description of modifiers in call /?or for /?
Run the batch file from the scheduler.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question