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

Compatibility issue with CMD.EXE

Discussion in 'Support' started by rdoerrer, Dec 4, 2009.

  1. rdoerrer

    Joined:
    Aug 3, 2009
    Messages:
    2
    Likes Received:
    0
    I have to call .cmd scripts from TCC wich contain environment variables with embedded dots like:

    set A.B.C=something

    and later use them in this way:

    echo %A.B.C%

    I will not get

    something

    (thats what CMD.EXE yields) but

    .B.C

    because TCC treats the first dor as terminator and, of course %A is not defined.

    Would it be possible to:

    1) add a switch to setdos that allows dots in variable names?
    2) allow dots in *.cmd scripts all the time?

    or is there already a work-arround.
    Thanks for your suggestions
     
  2. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,312
    Likes Received:
    39
    You can reference a variable with strange characters in the name by using the brackets syntax:

    Code:
    echo %[a.b.c]
    But of course CMD.EXE doesn't understand that. I really think you'd simplify your life by using underscores instead of periods in variable names.
     
  3. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,870
    Likes Received:
    83
    Definitely not #2, as that would break a few bazillion batch files & aliases
    that expect a '.' to be an extension prefix.

    Possibly #1 -- I'll add it to the suggestion list for the next version.

    Rex Conn
    JP Software
     

Share This Page