Outbreaker Posted May 14, 2010 Share Posted May 14, 2010 HI Is it possible to only delete same files in a folder with only one command line.ExempleDEL /Q "C:\test\folder\" file1.inf, file2.gif, file3.sys ...Or:DEL /Q "C:\test\folder\"file1.inffile2.giffile3.sy......Or:DEL /Q "C:\test\folder\" "a_list_of_filenames_for_deleting.txt"I couldn't not find anything in goolge Link to comment Share on other sites More sharing options...
cluberti Posted May 14, 2010 Share Posted May 14, 2010 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. Link to comment Share on other sites More sharing options...
Outbreaker Posted May 14, 2010 Author Share Posted May 14, 2010 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. Link to comment Share on other sites More sharing options...
Yzöwl Posted May 15, 2010 Share Posted May 15, 2010 All you need to do then is navigate to the folder first!CD /D X:\PathTo\FolderWithFilesInDEL file1.ext file4.ext file7.ext Link to comment Share on other sites More sharing options...
Outbreaker Posted May 15, 2010 Author Share Posted May 15, 2010 (edited) THX Yes this does the job didnt think of this "cd" command and that it would work. Edited May 15, 2010 by Outbreaker Link to comment Share on other sites More sharing options...
cluberti Posted May 15, 2010 Share Posted May 15, 2010 I also tried it by passing full paths in the file list, and it worked fine that way too. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now