Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8227263
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T16:04:06+00:00 2026-06-07T16:04:06+00:00

I am testing some small scripts that I have. This particular one is driving

  • 0

I am testing some small scripts that I have. This particular one is driving me crazy. In my mind it should work, but it is not doing what I thought it would/should.

@echo off
echo testing the issue
echo.

ECHO Checking the log file for errors...
echo %errorlevel%
FINDSTR /C:"open failed" C:\automatic_deployment\test1.txt 
echo %errorlevel%
if %errorlevel% == 0 (
ECHO Deployment failed.
pause
GOTO quit) else (GOTO TSTErrChecking1)

:TSTErrChecking1
FINDSTR /C:"does not exist" C:\automatic_deployment\test1.txt
echo %errorlevel%
if %errorlevel% == 0 (
ECHO Deployment failed.
pause
GOTO quit) else (GOTO TSTErrChecking2)

:TSTErrChecking2
FINDSTR /C:"Logon failed" C:\automatic_deployment\test1.txt 
echo %errorlevel%
if %errorlevel% == 0 (
ECHO Deployment failed.
pause
GOTO quit) else ( GOTO TSTErrChecking3)

:TSTErrChecking3
FINDSTR /C:"Failure" C:\automatic_deployment\test1.txt 
echo %errorlevel% 
if %errorlevel% == 0 (
ECHO Deployment failed.
pause
GOTO quit) else ( GOTO TSTErrChecking4)

:TSTErrChecking4
FINDSTR /C:"RC (return code) = 0" C:\automatic_deployment\test1.txt 
echo %errorlevel%
IF %ERRORLEVEL% == 0 (
ECHO Deployment was successful.
pause
GOTO quit) ELSE (
ECHO Deployment failed.
pause
GOTO quit)


:quit
exit

As you can see I am using “FINDSTR” to find certain words/strings from a small test1.txt file and act accordingly. I want it to say “deployment failed” and quit asap if it sees any “fail”/ “does not exist”/”open failed”. If it cannot find anyone of those above and finds the “RC (return code) = 0” I want it to say it was “successful”.

So, i put all those test words and strings in my test1.txt file and tested the batch script, but it keeps skipping (i think) all those fail hints/words and keeps saying it was successful. Plz, help. Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T16:04:07+00:00Added an answer on June 7, 2026 at 4:04 pm

    I just didn’t have the matching strings to search for. I didn’t know that FINDSTR looked for EXACTLY the same case letters when searching and comparing. That was the problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi I'm testing some CRUD operations in Nhibernate. I have 3 tests in this
I have created an additional thread in some small testing app and want to
I have a small script here that I need some help with: for song
I'm currently doing some testing work with TOR and ran in to a small
I have been doing some testing with ObjectiveResource (iOS->Rails bridge). Things seem to work,
After some testing with a completed product, I have just found that the hardware
I am currently working on a small program that should comment out some code
So, here is the question. I have a small flash application that sends some
I'm testing some methods that involve email, and am trying to use a mock
I am testing some db layer functions. In one, I am simulating the user

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.