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













2















I want to delete all files in a folder that start with a certain string, for example "File_EXC" and that are .zip files.










share|improve this question


























    2















    I want to delete all files in a folder that start with a certain string, for example "File_EXC" and that are .zip files.










    share|improve this question
























      2












      2








      2








      I want to delete all files in a folder that start with a certain string, for example "File_EXC" and that are .zip files.










      share|improve this question














      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 8 hours ago









      nicknick

      1415 bronze badges




      1415 bronze badges




















          2 Answers
          2






          active

          oldest

          votes


















          5















          1. CD to the correct path.

          2. DEL FILE_EXC*.ZIP

          3. Press Enter





          share|improve this answer
































            0














            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.msc and 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





            share|improve this answer


















            • 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













            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
            );



            );













            draft saved

            draft discarded


















            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









            5















            1. CD to the correct path.

            2. DEL FILE_EXC*.ZIP

            3. Press Enter





            share|improve this answer





























              5















              1. CD to the correct path.

              2. DEL FILE_EXC*.ZIP

              3. Press Enter





              share|improve this answer



























                5












                5








                5








                1. CD to the correct path.

                2. DEL FILE_EXC*.ZIP

                3. Press Enter





                share|improve this answer
















                1. CD to the correct path.

                2. DEL FILE_EXC*.ZIP

                3. Press Enter






                share|improve this answer














                share|improve this answer



                share|improve this answer








                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





















                    0














                    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.msc and 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





                    share|improve this answer


















                    • 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















                    0














                    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.msc and 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





                    share|improve this answer


















                    • 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













                    0












                    0








                    0







                    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.msc and 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





                    share|improve this answer













                    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.msc and 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






                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    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












                    • 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

















                    draft saved

                    draft discarded
















































                    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.




                    draft saved


                    draft discarded














                    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





















































                    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







                    Popular posts from this blog

                    Canceling a color specificationRandomly assigning color to Graphics3D objects?Default color for Filling in Mathematica 9Coloring specific elements of sets with a prime modified order in an array plotHow to pick a color differing significantly from the colors already in a given color list?Detection of the text colorColor numbers based on their valueCan color schemes for use with ColorData include opacity specification?My dynamic color schemes

                    Invision Community Contents History See also References External links Navigation menuProprietaryinvisioncommunity.comIPS Community ForumsIPS Community Forumsthis blog entry"License Changes, IP.Board 3.4, and the Future""Interview -- Matt Mecham of Ibforums""CEO Invision Power Board, Matt Mecham Is a Liar, Thief!"IPB License Explanation 1.3, 1.3.1, 2.0, and 2.1ArchivedSecurity Fixes, Updates And Enhancements For IPB 1.3.1Archived"New Demo Accounts - Invision Power Services"the original"New Default Skin"the original"Invision Power Board 3.0.0 and Applications Released"the original"Archived copy"the original"Perpetual licenses being done away with""Release Notes - Invision Power Services""Introducing: IPS Community Suite 4!"Invision Community Release Notes

                    François Viète Contents Biography Work and thought Bibliography See also Notes Further reading External links Navigation menup. 21Google Bookspp. 75–77Google BooksDe thou (from University of Saint Andrews)ArchivedGoogle BooksGoogle BooksGoogle BooksGoogle booksGoogle Bookscc-parthenay.frL'histoire universelle (fr)Universal History (en)ArchivedAdsabs.harvard.eduPagesperso-orange.frArchive.orgChikara Sasaki. Descartes' mathematical thought p.259Google BooksGoogle BooksGoogle Bookspp. 152 and onwardGoogle BooksGoogle BooksScribd.comGoogle Books1257-7979Google BooksGoogle BooksGoogle BooksGoogle BooksGoogle BooksGoogle BooksGallica.bnf.frGoogle BooksGoogle Books"François Viète"Francois Viète: Father of Modern Algebraic NotationThe Lawyer and the GamblerAbout TarporleySite de Jean-Paul GuichardL'algèbre nouvelle"About the Harmonicon"cb120511976(data)1188044800000 0001 0913 5903n82164680ola2013766880073431702w6vt1sb70287374827140948071409480