Windows 10: How do I use the command prompt to delete files with similar names?

Page 2 of 2 FirstFirst 12
  1.    07 Mar 2017 #11

    Hotsuma said: View Post
    ...except for the ones that have the "[!]" at the end...
    That might be trickier than it looks; let a few others weigh in before doing mass deletes.
      My ComputerSystem Spec


  2. Posts : 6,392
    10 Home x64 (1709) (10 Pro on 2nd pc)
       07 Mar 2017 #12

    You need to use one or more wildcards that would match the ones you want to delete, but not match the one you want to keep like this (make sure there'a space between the two wildcards): del *[b*.gb *[t*.gb

    Just to be sure, you could first give all your [!] files the read-only attribute with attrib *[!].* +R
    You can make them read-write again later with attrib *[!].* -R

    Code:
     Directory of C:\TEMP\TEST
    07/03/2017  20:34    <DIR>          .
    07/03/2017  20:34    <DIR>          ..
    07/03/2017  20:34                 7 Amazing Spider-Man, The (UE) [b2].gb
    07/03/2017  20:34                 7 Amazing Spider-Man, The (UE) [b3].gb
    07/03/2017  20:34                 7 Amazing Spider-Man, The (UE) [!].gb
    07/03/2017  20:34                 7 Amazing Spider-Man, The (UE) [b1].gb
    07/03/2017  20:34                 7 Amazing Spider-Man, The (UE) [b4].gb
    07/03/2017  20:34                 7 Amazing Spider-Man, The (UE) [b5].gb
    07/03/2017  20:34                 7 Amazing Spider-Man, The (UE) [T+Fre_Emulation-151].gb
    07/03/2017  20:34                 7 Amazing Spider-Man, The (UE) [T+Ger0.99_Star-trans].gb
    07/03/2017  20:34               452 TEST.bat
                   9 File(s)            508 bytes
                   2 Dir(s)  181,137,719,296 bytes free
    C:\TEMP\TEST>del *[b*.gb *[t*.gb
    C:\TEMP\TEST>dir
     Volume in drive C is WINDOWS
     Volume Serial Number is 3440-777B
     Directory of C:\TEMP\TEST
    07/03/2017  20:36    <DIR>          .
    07/03/2017  20:36    <DIR>          ..
    07/03/2017  20:34                 7 Amazing Spider-Man, The (UE) [!].gb
    07/03/2017  20:34               452 TEST.bat
                   2 File(s)            459 bytes
                   2 Dir(s)  181,137,735,680 bytes free
      My ComputersSystem Spec


 
Page 2 of 2 FirstFirst 12

Related Threads
Command Prompt in General Support
Every time I use my laptop there is this COMMAND BOX that appears and within a second it disappears. Its really irritating and the worst part is if I am playing games or using any other program at that time the program that I am using minimizes...
Command prompt pop up in General Support
Hi, for a while now i been having an issue with command prompt. The command prompt will randomly pop up and close immediately. i have had this issue for a while but it didn't really effect me. Recently ive been playing a lot of games and the...
Can you delete wake timers from the command prompt? I am thinking specifically of wake timers created by Update Orchestrator, which cannot be permanently disabled no matter how many settings you alter (and believe me, I have spent hours and days...
Solved Command Prompt in General Support
How to call up "command Prompt (Admin) from the "run" dialog box win 10 Home?
Command Prompt? in General Support
Guys, I'm going to try one last time. The error code I received told to me to empty files and then "Run the command prompt as an administrator"?? Then, type wuauclt.exe/update now??......I don't know what run the command prompt means. I have no...
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 01:56.
Find Us