1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Fixed Behavior different than CMD

Discussion in 'Support' started by deleyd, Aug 28, 2015.

  1. deleyd

    Joined:
    Aug 1, 2008
    Messages:
    16
    Likes Received:
    0
    I have Take Command v18.0

    When I run the following batch file:

    set start_year=2015
    set end_year=2016
    echo start_year=%start_year%
    echo end_year=%end_year%
    set FISC=FY%start_year:~-2%-%end_year:~-2%
    echo FISC=%FISC%


    the result is:

    FISC=FY-

    When I run it under Windows CMD the result is:

    FISC=FY15-16

    How can I write this so Take Command gives me the same result as CMD?
     
  2. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,970
    Likes Received:
    30
    Similarly,
    Code:
    v:\> ver
    
    TCC  18.00.30  Windows 7 [Version 6.1.7601]
    
    v:\> set foo=abcd
    
    v:\> echo %foo:~-2%
    ECHO is OFF
    
    v:\> cmd /c echo %%foo:~-2%%
    cd
    
    v:\>
     

Share This Page