1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Batch file to delete all *.exe except for one

Discussion in 'Windows XP' started by sulasno, Jan 5, 2011.

Thread Status:
Not open for further replies.
Advertisement
  1. sulasno

    sulasno Thread Starter

    Joined:
    Jul 3, 2010
    Messages:
    162
    is there a command available ? my workaround is to rename donotdelete.exe to donotdelete.bat; run a batch file to delete all *.exe and then rename donotdelete.bat to donotdelete.exe is there a more elegant solution ? tia
     
  2. eddie5659

    eddie5659 Moderator Malware Specialist

    Joined:
    Mar 19, 2001
    Messages:
    35,669
    I'm a little curious, but why do you want to delete all exe's on a system?
     
  3. sulasno

    sulasno Thread Starter

    Joined:
    Jul 3, 2010
    Messages:
    162
    they are just a bunch of batch to exe files
     
  4. sulasno

    sulasno Thread Starter

    Joined:
    Jul 3, 2010
    Messages:
    162
    I managed to find the solution :) shout if anyone wants it
     
  5. surferdude2

    surferdude2

    Joined:
    Jul 6, 2010
    Messages:
    619
    maybe use the /a switch after using the proper attrib command to set the attributes to suit your purpose??
     
  6. sulasno

    sulasno Thread Starter

    Joined:
    Jul 3, 2010
    Messages:
    162
    for %%i in (*.exe) do if not "%%i"=="Downloader.exe" del /q "%%i" I simply put the above in the directory and all exe files are deleted except for Downloader.exe
     
  7. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Similar Threads - Batch file delete
  1. Robertico22
    Replies:
    8
    Views:
    645
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/972950

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice