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

  • Home
  • SEARCH
  • 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 7757577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T13:07:57+00:00 2026-06-01T13:07:57+00:00

I need help with CMD scripts. Here is my problem: I have list of

  • 0

I need help with CMD scripts. Here is my problem:

I have list of items, also I have variable which show for example current version of SDK.

set CURRENT_VERSION = 2.3
set LIST_OF_ITEMS   = (4.0.3 2.3.3 2.2)

I want to write something like this

for %%A in %CURRENT_VERSION % do (
    if [%%A] grt [%SDK_VERSION%] (
        echo greater. 
    )
)

Also I want to now what must I write to break or continue in for.

  • 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-01T13:07:59+00:00Added an answer on June 1, 2026 at 1:07 pm

    This code is almost the same you wrote, but it works.

    set CURRENT_VERSION=2.3
    set LIST_OF_ITEMS=4.0.3 2.3.3 2.2
    
    for %%A in (%LIST_OF_ITEMS%) do (
        if [%%A] gtr [%CURRENT_VERSION%] (
            echo greater.
            goto continue
        )
    )
    :continue
    

    However, I think the comparison is done in reversed order, so it should be:

    set CURRENT_VERSION=2.3
    set LIST_OF_ITEMS=4.0.3 2.3.3 2.2
    
    for %%A in (%LIST_OF_ITEMS%) do (
        if [%CURRENT_VERSION%] gtr [%%A] (
            echo Current version greater %%A.
            goto continue
        )
    )
    echo Current version too low
    goto :EOF
    
    :continue
    

    Note that version numbers are compared like strings. If you want to have right results with these numbers, then they both must have the same format; that is:

    set CURRENT_VERSION=2.3.0
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

need help regarding USSD Gateway. I have to develop an app, which will directly
need help to create regular expression matching string www.*.abc.*/somestring Here * is wild card
need help/guide for sql select query, I have 2 table stock and stock_history, in
need help in error in database pivot. i have table tamed table_score like below:
I need help with debugging this piece of code. I know the problem is
I need some help translating the following shell scripts calls to PHP curl -3
I need help. In my current development one of the requirements says: The server
Need help writing a script downloads data from google insight using c# this is
I need help with both of my operator overloading functions presented below. I'm unsure
I need help finding why I'm getting a null pointer exception. I've tried going

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.