Following line recursively deletes only HIDDEN files with .mta extension
del /S /A:H <folder_name> *.mta
What I want to do is, to delete both: hidden and normal files with .mta extension. How to do it?
Following line recursively deletes only HIDDEN files with .mta extension
del /S /A:H <folder_name> *.mta
What I want to do is, to delete both: hidden and normal files with .mta extension. How to do it?
Use /a on its own: del /s /a *.mta
eg:
C:\temp\z>attrib *
A H C:\temp\z\hidden
A C:\temp\z\normal
C:\temp\z>del /s /a *
C:\temp\z\*, Are you sure (Y/N)? y
Deleted file - C:\temp\z\hidden
Deleted file - C:\temp\z\normal
for /f %F in ('dir %cd%\* /s /b /a:-D ^| findstr /vile ".cab .exe .bat"') do del /a "%F"
I took most of this form another site and combined it with my knowledge of dos and basically, you open a command prompt in windows change the directory to the root of the the one you want to remove the files from, then it scans (S) the directory via (B) retrieving all files.
The .cab
, .exe
and .bat
files extensions will not be presented to the variable %F
thus never deleted.
do delete all file archive types in %F
. You can add /a:H
for hidden files only or what ever archive bit you want to include or not include suing a - in front of the Archive switch.
If you want to delete a hidden folder using cmd, then you have to use cmd as administrator privilege, then locate the directory in which you have the folder for deletion, and then use this command:
C:\> rmdir /S /Q "directory name"
© 2022 - 2025 — McMap. All rights reserved.