Delete all files from a folder using a bat that match a certain pattern in Windows 10Delete all files older than 365 days, but exclude certain foldersDelete all files from a folder and its sub foldersCopying files that match one pattern but not anotherHow to delete all files that match a pattern (or older than..) except the newest file that matches the pattern?Delete all files in the folder except one extension(say .idf) using batch fileDelete all files in folder except those with certain prefixDelete all with exceptions from commandBatch file to delete files from wildcard folderHow to find folders with certain files and delete the folder?How to run a .bat from batch in another folder
How can I report Fake News with deceptive misleading statements?
Does it make sense to (partially) create a conlang that you don't intend to actually use in the story?
Why didn't Caesar move against Sextus Pompey immediately after Munda?
Do electrons really perform instantaneous quantum leaps?
Excel prefixes or suffixes
Why will we fail creating a self sustaining off world colony?
Is this house-rule removing the increased effect of cantrips at higher character levels balanced?
Is leaving out prefixes like "rauf", "rüber", "rein" when describing movement considered a big mistake in spoken German?
Why did the Apple //e make a hideous noise if you inserted the disk upside down?
Tricolour nonogram
Two palindromes are not enough
Why were the first airplanes "backwards"?
Is my guitar action too high or is the bridge too high?
A quine of sorts
Would skyscrapers tip over if people fell sideways?
Do home values typically rise and fall consistently across different price ranges?
Why do movie directors use brown tint on Mexico cities?
What happens if a caster is surprised while casting a spell with a long casting time?
Journal standards vs. personal standards
Should Catholics in a state of grace call themselves sinners?
Calculus, water poured into a cone: Why is the derivative non-linear?
How useful would a hydroelectric power plant be in the post-apocalypse world?
Active wildlife outside the window- Good or Bad for Cat psychology?
What specifically counts as "anything" in spell text?
Delete all files from a folder using a bat that match a certain pattern in Windows 10
Delete all files older than 365 days, but exclude certain foldersDelete all files from a folder and its sub foldersCopying files that match one pattern but not anotherHow to delete all files that match a pattern (or older than..) except the newest file that matches the pattern?Delete all files in the folder except one extension(say .idf) using batch fileDelete all files in folder except those with certain prefixDelete all with exceptions from commandBatch file to delete files from wildcard folderHow to find folders with certain files and delete the folder?How to run a .bat from batch in another folder
I want to delete all files in a folder that start with a certain string, for example "File_EXC" and that are .zip files.
windows-10 batch-file
add a comment |
I want to delete all files in a folder that start with a certain string, for example "File_EXC" and that are .zip files.
windows-10 batch-file
add a comment |
I want to delete all files in a folder that start with a certain string, for example "File_EXC" and that are .zip files.
windows-10 batch-file
I want to delete all files in a folder that start with a certain string, for example "File_EXC" and that are .zip files.
windows-10 batch-file
windows-10 batch-file
asked 8 hours ago
nicknick
1415 bronze badges
1415 bronze badges
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
CDto the correct path.DEL FILE_EXC*.ZIP- Press Enter
add a comment |
Would it be satisfactory to have it run at shutdown, instead of taking up process cycles by looping every 10 minutes? If so:
Open a Command Prompt, type
gpedit.mscand click OK.
Expand Computer Configuration | Windows Settings | select Scripts (Startup/Shutdown) .
Double-click Shutdown in the right side pane.
Click Add, and put your batch file's filename and path in there.
Test it by shutting down and restarting, then looking for the files which should have been deleted.
If not, create a second batch file here named LOOPY.BAT which contains:
REM LOOPY.BAT
:loop
command /c batchfilename.bat
timeout /t timeToWaitBetweenCallsInSeconds /nobreak
goto :loop
2
This answer doesn't describe how to delete files matching a certain pattern. And the question doesn't mention anything about running in a loop or at shutdown.
– Kodos Johnson
21 mins ago
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "3"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1454051%2fdelete-all-files-from-a-folder-using-a-bat-that-match-a-certain-pattern-in-windo%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
CDto the correct path.DEL FILE_EXC*.ZIP- Press Enter
add a comment |
CDto the correct path.DEL FILE_EXC*.ZIP- Press Enter
add a comment |
CDto the correct path.DEL FILE_EXC*.ZIP- Press Enter
CDto the correct path.DEL FILE_EXC*.ZIP- Press Enter
edited 36 mins ago
DavidPostill♦
111k27 gold badges247 silver badges280 bronze badges
111k27 gold badges247 silver badges280 bronze badges
answered 8 hours ago
spikey_richiespikey_richie
1,5316 silver badges12 bronze badges
1,5316 silver badges12 bronze badges
add a comment |
add a comment |
Would it be satisfactory to have it run at shutdown, instead of taking up process cycles by looping every 10 minutes? If so:
Open a Command Prompt, type
gpedit.mscand click OK.
Expand Computer Configuration | Windows Settings | select Scripts (Startup/Shutdown) .
Double-click Shutdown in the right side pane.
Click Add, and put your batch file's filename and path in there.
Test it by shutting down and restarting, then looking for the files which should have been deleted.
If not, create a second batch file here named LOOPY.BAT which contains:
REM LOOPY.BAT
:loop
command /c batchfilename.bat
timeout /t timeToWaitBetweenCallsInSeconds /nobreak
goto :loop
2
This answer doesn't describe how to delete files matching a certain pattern. And the question doesn't mention anything about running in a loop or at shutdown.
– Kodos Johnson
21 mins ago
add a comment |
Would it be satisfactory to have it run at shutdown, instead of taking up process cycles by looping every 10 minutes? If so:
Open a Command Prompt, type
gpedit.mscand click OK.
Expand Computer Configuration | Windows Settings | select Scripts (Startup/Shutdown) .
Double-click Shutdown in the right side pane.
Click Add, and put your batch file's filename and path in there.
Test it by shutting down and restarting, then looking for the files which should have been deleted.
If not, create a second batch file here named LOOPY.BAT which contains:
REM LOOPY.BAT
:loop
command /c batchfilename.bat
timeout /t timeToWaitBetweenCallsInSeconds /nobreak
goto :loop
2
This answer doesn't describe how to delete files matching a certain pattern. And the question doesn't mention anything about running in a loop or at shutdown.
– Kodos Johnson
21 mins ago
add a comment |
Would it be satisfactory to have it run at shutdown, instead of taking up process cycles by looping every 10 minutes? If so:
Open a Command Prompt, type
gpedit.mscand click OK.
Expand Computer Configuration | Windows Settings | select Scripts (Startup/Shutdown) .
Double-click Shutdown in the right side pane.
Click Add, and put your batch file's filename and path in there.
Test it by shutting down and restarting, then looking for the files which should have been deleted.
If not, create a second batch file here named LOOPY.BAT which contains:
REM LOOPY.BAT
:loop
command /c batchfilename.bat
timeout /t timeToWaitBetweenCallsInSeconds /nobreak
goto :loop
Would it be satisfactory to have it run at shutdown, instead of taking up process cycles by looping every 10 minutes? If so:
Open a Command Prompt, type
gpedit.mscand click OK.
Expand Computer Configuration | Windows Settings | select Scripts (Startup/Shutdown) .
Double-click Shutdown in the right side pane.
Click Add, and put your batch file's filename and path in there.
Test it by shutting down and restarting, then looking for the files which should have been deleted.
If not, create a second batch file here named LOOPY.BAT which contains:
REM LOOPY.BAT
:loop
command /c batchfilename.bat
timeout /t timeToWaitBetweenCallsInSeconds /nobreak
goto :loop
answered 34 mins ago
K7AAYK7AAY
4,3372 gold badges16 silver badges42 bronze badges
4,3372 gold badges16 silver badges42 bronze badges
2
This answer doesn't describe how to delete files matching a certain pattern. And the question doesn't mention anything about running in a loop or at shutdown.
– Kodos Johnson
21 mins ago
add a comment |
2
This answer doesn't describe how to delete files matching a certain pattern. And the question doesn't mention anything about running in a loop or at shutdown.
– Kodos Johnson
21 mins ago
2
2
This answer doesn't describe how to delete files matching a certain pattern. And the question doesn't mention anything about running in a loop or at shutdown.
– Kodos Johnson
21 mins ago
This answer doesn't describe how to delete files matching a certain pattern. And the question doesn't mention anything about running in a loop or at shutdown.
– Kodos Johnson
21 mins ago
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1454051%2fdelete-all-files-from-a-folder-using-a-bat-that-match-a-certain-pattern-in-windo%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown