Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
search and delete batch file
Name: moviesnmore Date: April 18, 2008 at 10:56:31 Pacific OS: xp, 2003 CPU/Ram: n/a Product: n/a
Comment:
I found this code and tried to modify it for my purposes.
I wanted to find the word "cookie" in some text based files and then delete the file if found. If the word "cookie" is on its own line, the file is deleted. But if the word is in the middle of a string, it is not deleted. Any thoughts on how to fix this?
----------------
@echo off setLocal EnableDelayedExpansion
pushd d:\Temp
for /f "tokens=* delims=* " %%e in ('dir/b/a-d *.pkg') do ( for /f "tokens=* delims=* " %%a in (%%e) do ( echo %%a | find "cookie" > nul if not errorlevel 1 echo del %%e ) )
Summary: This batch Will Search for the specified file on the hard disk and delete when found Remove "echo" from |echo del "%%f" /f| to make it delete the file :: --- BATCH SCRIPT START --- :bof @echo ...
Summary: How can I create a self deleting batch file. i have the batch file and I know you can use the del command but what I want to do is have it self delete after a certain date. Any help would be appreciat...
Summary: I have share on a server in which i have files being saved to. I need to purge this folder every so often of files that are no older then 2 days. I have found a batch file to do this. How ever on the ...