Solved

Batch to find/delete

Posted on 2014-09-04
2
288 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:Wass_QA
2 Comments
 
LVL 68

Accepted Solution

by:
Qlemo earned 500 total points
Comment Utility
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:Wass_QA
Comment Utility
Thanks you very much.
Exactly what I needed.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now