Microsoft DOS
--
Questions
--
Followers
Top Experts
How do I delete
I have a folder with several sub direcrorries and then files, How can I run a Dos command to detele all MS Word file only .doc? Also, I want to log the output for the file deleted ( file names).
Zero AI Policy
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
ASKER CERTIFIED SOLUTION
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Here's a small BAT script that will log file names.
@echo off
set BaseDir=c:\basefolder
set LogFile=c:\temp\dellog.txt
(
for /f "tokens=*" %%A in ('dir /b /s /a-d "c:\basefolder\*.doc"') do (
echo Deleting: %%A
del "%%~A"
)
)>"%LogFile%"
~bp






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
Microsoft DOS
--
Questions
--
Followers
Top Experts
Microsoft Disk Operating System (MS-DOS) was an operating system for x86-based personal computers, and traces of it are still found in the Windows operating system. DOS is still used in some embedded systems and for certain legacy 16-bit networks.