del /s .jpg
deletes all .jpgs .. but the problem is: it shows, in cmd when executed =>
C:\blabla..\this.jpg is deleted..
I want to turn this off. Such that user will not know what is happening (i.e, what files are being deleted).
In computing, del (or erase ) is a command in command-line interpreters (shells) such as COMMAND.COM , cmd.exe , 4DOS, NDOS, 4OS2, 4NT and Windows PowerShell. It is used to delete one or more files or directories from a file system. del / erase.
Turn echo off to suppress showing the command being run, and redirect output to null as @Sico suggested.
@echo off del /s *.jpg >nul 2>&1
You should see nothing displayed when the bat file is run.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With