Computing.Net > Forums > Programming > Batch file Help

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.

Batch file Help

Reply to Message Icon

Name: kipkenyen
Date: March 2, 2009 at 05:23:53 Pacific
OS: Windows XP/ Server 2003
Subcategory: Batch
Comment:

Hi, I need some help with a batch file.

I want to search the following txt file c:\backup logs\summary.txt for the string "##Status=Failed" and if this is present then execute another batch file called "Backupfailed.bat

Can anyboody help?



Sponsored Link
Ads by Google

Response Number 1
Name: IVO
Date: March 2, 2009 at 05:50:00 Pacific
Reply:

@echo off
find "##Status=Failed" "C:\backup logs\summary.txt" > nul && backupfailed
:: End_Of_Batch

The above script transfers control to backupfailed if the string is found and never returns to the calling one. If you want to go back after the execution of backupfailed replace with

call backupfailed


0

Response Number 2
Name: kipkenyen
Date: March 2, 2009 at 06:18:05 Pacific
Reply:

Cheers IVO that worked a treat, I didnt realise it was that easy,
Thanks again


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Batch file Help

batch file help www.computing.net/answers/programming/batch-file-help/13830.html

Batch File Help www.computing.net/answers/programming/batch-file-help-/11464.html

batch file help www.computing.net/answers/programming/batch-file-help/190.html