Deleting hidden and read-only files with pure Batch [SOLVED]

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

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

Deleting hidden and read-only files with pure Batch [SOLVED]

#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
Last edited by DOSadnie on 05 Jul 2025 08:41, edited 1 time in total.

aGerman
Expert
Posts: 4715
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

DOSadnie
Posts: 159
Joined: 21 Jul 2022 15:12
Location: Coding Kindergarten

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

#3 Post by DOSadnie » 05 Jul 2025 08:41

Yes, thank you

I had to make sure I can go to basics for test purposes, because some of my more elaborate code somehow stopped working [viewtopic.php?f=3&t=12104&p=71384#p71384]. I think I need to take a break because its all getting mixed up in my head

Post Reply