?
Solved

Batch to find/delete

Posted on 2014-09-04
2
Medium Priority
?
345 Views
Last Modified: 2014-09-04
Hello,
Can you please help,
I have few .txt files in a specific  Directory.
C:\Users\Wassim\__Task_Schedules\_Files_FTP

One of the text files contains a string
HResult 0x35, Level 16, State 1

How can I delete this file through a batch command.

thanks
0
Comment
Question by:W.E.B
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 70

Accepted Solution

by:
Qlemo earned 2000 total points
ID: 40304819
In a batch file (.cmd or .bat):
@echo off
for %%F in (C:\Users\Wassim\__Task_Schedules\_Files_FTP\*.txt) do ^
find <"%%~F" "HResult 0x35, Level 16, State 1" >nul && del "%%~F"

Open in new window

You can run this at the prompt if you replace each %% by % .
0
 

Author Closing Comment

by:W.E.B
ID: 40304840
Thanks you very much.
Exactly what I needed.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You may have already been in the need to update a whole folder stucture using a script. Robocopy does it well and even provides a list of non-updated files in a log (if asked to). Generally those files that were locked by a user or a process by the …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question