Deleting hidden and read-only files with pure Batch

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
DOSadnie
Posts: 157
Joined: 21 Jul 2022 15:12
Location: Coding Kindergarten

Deleting hidden and read-only files with pure Batch

#1 Post by DOSadnie » 04 Jul 2025 10:37

Is it at all possible to use only a single UTF-8 BAT file and be able to find e.g.

P:\Excel file deletion test\hidden and read only\~$test file for potential deletion.xlsm

and delete it successfully?

I have no problem with doing this using a PS1 file, but I would like to do it using only Batch

aGerman
Expert
Posts: 4713
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Deleting hidden and read-only files with pure Batch

#2 Post by aGerman » 04 Jul 2025 12:10

You mean someting like this?

Code: Select all

del /f /a "D:\somewhere\whatever file.ext"
Steffen

Post Reply