• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Batch file to delete certain files?

edro

Lifer
I want to delete files, in a certain folder, that contain a certain criteria.... like, if the file contains "(J)", I want the BAT file to delete it.

Is this easily done?
 
Cool, but will that also delete files that conatin a capital J? I want it to delete only files that conatain this: (J)

 
Originally posted by: MichaelD
What does the

@echo off


do?

doesn't output the command to the dos window. You'll only see the results of the commands that are put in.
 
Originally posted by: edro13
Cool, but will that also delete files that conatin a capital J? I want it to delete only files that conatain this: (J)

So you're looking to delete files that contain that exact string in the filename? then it would be del *(J)*.*
 
Originally posted by: edro13
I used:
@echo off
cd c:\certain folder
del *(J)*

What does the period do? ex: *J.*

all file names that have J. in them (J then a period right after)

that's not what you want though, as described by your original question
 
Originally posted by: edro13
I used:
@echo off
cd c:\certain folder
del *(J)*

What does the period do? ex: *J.*

It's just an old dos thing, since filename's contain a period to separate the actual name from the extension. *(J)* is the same thing, you don't need to put in the .*
 
Originally posted by: MAME
Originally posted by: edro13
I used:
@echo off
cd c:\certain folder
del *(J)*

What does the period do? ex: *J.*

all file names that have J. in them (J then a period right after)

that's not what you want though, as described by your original question

woops, I meant to put *J*.*, my bad 😱
 
Man I'm growing old.
rolleye.gif
The old DOS thing sheez....:Q
 
Originally posted by: KLin
Originally posted by: MAME
Originally posted by: edro13
I used:
@echo off
cd c:\certain folder
del *(J)*

What does the period do? ex: *J.*

all file names that have J. in them (J then a period right after)

that's not what you want though, as described by your original question

woops, I meant to put *J*.*, my bad 😱

Yup, I thought you had a typo there. Not many files have a period after a capital J 😀
 
Back
Top