Solved

Batch to find/delete

Posted on 2014-09-04
2
313 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 500 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Command prompt output to variable? 9 91
powershell script 9 81
Vbscript & Batch: restart servers with delay condition 2 46
Copy 20 files at a time from drive G to drive H 10 79
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

732 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