Solved

Batch to find/delete

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

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

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 …
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

930 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

9 Experts available now in Live!

Get 1:1 Help Now