Jump to content

Recommended Posts

Posted

HI :)

Is it possible to only delete same files in a folder with only one command line.

Exemple

DEL /Q "C:\test\folder\" file1.inf, file2.gif, file3.sys ...

Or:

DEL /Q "C:\test\folder\"

file1.inf

file2.gif

file3.sy

......

Or:

DEL /Q "C:\test\folder\" "a_list_of_filenames_for_deleting.txt"

I couldn't not find anything in goolge :(


Posted

Depends on the OS, but you should be able to run del /q /f <file list separated by spaces>. Note that if you do this, however, folders will NOT be deleted - rd must be used on directories/folders to delete them. However, this works just fine on files.

Posted

Yes but then the batch file must be also in the same folder where the files are. Like in the exemples i want to set a folder where the files are that should be deleted.

Posted

All you need to do then is navigate to the folder first!

CD /D X:\PathTo\FolderWithFilesIn
DEL file1.ext file4.ext file7.ext

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...