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 8176743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T23:18:57+00:00 2026-06-06T23:18:57+00:00

I’m running a batch file that: 1. Go thru ALL *.properties files in C:\ExecutionSDKTest_10.2.2

  • 0

I’m running a batch file that:
1. Go thru ALL *.properties files in C:\ExecutionSDKTest_10.2.2
2. Run them
3. compare line by line of the outputted log with ref log
But the cmd.exe keeps throwing me this error: “!fileName! was unexpected at this time. Any ideas?

CALL ant clean build compile 
REM Run ENG-zzz.properties  --> output to ENG-zzz.properties.log in Logs dir
REM loop thru/Run ALL .properties file names from "ExecutionSDKTest_10.2.2" folder
FOR %%G in (C:\ExecutionSDKTest_10.2.2\*.properties) DO (
set flag=true
Set fileName=%%~nxG
set testNum=!fileName:~0,7!
echo Running:!fileName!
java -jar Test.jar !fileName! > Logs\!fileName!.log

ECHO Create: Ref!fileName!.log at C:\ExecutionSDKTest_10.2.2\Logs
set logPath=C:\ExecutionSDKTest_10.2.2\Logs\!fileName!.log
set refLogPath=C:\ExecutionSDKTest_10.2.2\Logs\!testNum!-Ref.properties.txt
set lnCorrect=true
set errorLnCount=0
REM if ...Ref.txt doesnt Exist --> check certain lines of the log

REM assume ref.txt exists
<!logPath! (
    For /F "tokens=*" %%R in (!refLogPath!) DO (
        set logLine=
            set /p logLine=
        set refLogLine=%%R

        REM Check line by line of log against refLog
        REM assume ALL times have been replaced with: "xx:xx:xx"

        REM if corresponding lines mismatch
        if NOT !logLine!==!refLogLine! Do (
            set lnCorrect=false
            REM output to command line: can be put into .log/.txt later
            if errorLnCount==1 AND lnCorrect==false DO (
          ECHO The following line(s)  !fileName! are incorrect against corresponding line(s) in !testNum!-Ref.properties.txt 
             )
             ECHO !logLine!
        )
        )
    )

if lnCorrect=true Do Echo !fileName! Passed
  )
Pause
  • 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-06T23:18:59+00:00Added an answer on June 6, 2026 at 11:18 pm

    Your syntax is a bit odd (it’s simply wrong)
    if lnCorrect=true Do Echo !fileName! Passed

    1. The IF statement must not have a DO clause.
    2. compare needs two equal signs.
    3. There are not logic operators like AND, OR
    4. The variables must be expanded to be able to compare them

    So your line should look like
    if "!lnCorrect!"=="true" Echo !fileName! Passed

    And the other bug is in the line

    if errorLnCount==1 AND lnCorrect==false DO (
    

    This could be refactored to

    if !errorLnCount!==1 if !lnCorrect!==false (
    

    There is also a problem with the line

    ECHO The following line(s)  !fileName! are incorrect against
    

    The closing parenthesis will cause your problem, as it closes the if-clause and loop.
    Remove them or escape them

    ECHO The following line(s^)  !fileName! are ... corresponding line(s^) in ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I've got a string that has curly quotes in it. I'd like to replace
I want use html5's new tag to play a wav file (currently only supported
I am doing a simple coin flipping experiment for class that involves flipping a

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.