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

Cmd.exe's doskey campatibility

Discussion in 'TCC/LE Support' started by holla, Nov 14, 2008.

  1. holla

    Joined:
    Nov 13, 2008
    Messages:
    17
    Likes Received:
    0
    I am switching over from cmd.exe to TCC LE.
    I have some aliases files that I load using "doskey /macrofile=aliases.dat"
    command.
    typical entries in this aliases file use $t (The command seperator of cmd.exe)
    and $* (All parameters supplied in the command line) extensively.

    When I use this aliases file using "alias /r" command, later when I invoke aliases having $t or $* in it, TCCLE complains.
    Is there a way to make a single aliases to be used by doskey as well as TCC LE? This is needed because I need to work on others machines(no TCCLE), with my aliases(take it on a stick).
    Examples from my alias file:

    os=dir /os $*
    od=dir /od $*
    mc=md $* $t cd $*
    </pre>

    for example, when I type mc t1, it tries to create directories called $*, $t, cd, $* and t1.
     
  2. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,307
    Likes Received:
    39
    DOSKEY's macro facility is different from TCC aliases in more ways than just special character handling; I don't think you'll be able to use the same file with both. Instead, you might carry two files, one with DOSKEY macros and another with TCC aliases. Use your text editor's search-and-replace function to translate $T to & or %+, and $* to %$.

    Alternately, I would expect TCC/LE to run from a USB stick, though I haven't actually tried it.
     
  3. holla

    Joined:
    Nov 13, 2008
    Messages:
    17
    Likes Received:
    0
    That would solve my problem...

    Why did nt I think of it? :-(
     
  4. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,520
    Likes Received:
    4
    JP Software Forums" <neil@jpsoft.com>; "holla wrote:
    | I am switching over from cmd.exe to TCC LE.
    ...
    | When I use this aliases file using "alias /r" command, later when I
    | invoke aliases having $t or $* in it, TCCLE complains.
    | Is there a way to make a single aliases to be used by doskey as well
    | as TCC LE? This is needed because I need to work on others
    | machines(no TCCLE), with my aliases(take it on a stick).

    You can take TCCLE with you on the stick, but there is no "common syntax"
    for TCCLE and DOSKEY (the latter of which is not an integral part of CMD,
    just another MS tool). The symbolic form of the command separator in TCCLE
    is %+ (percent sign followed by plus sign). If you use the default special
    character in TCCLE, $* should work to specify "the whole command tail".
    --
    HTH, Steve
     
  5. samintz

    samintz Scott Mintz

    Joined:
    May 20, 2008
    Messages:
    1,190
    Likes Received:
    11
    Since TCC/LE is a free product there is no reason why you couldn't take it
    along on a USB key. If you are already bringing your key with your
    aliases file with you, you might as well bring TCC/LE along too.

    If $t and $* are the only changes required between the two environments,
    you could easily "translate" the doskey alias file to one TCC could use.
    In your TCSTART file, instead of ALIAS /R do this instead:

    setdos /x-456
    do al in @aliases.dat
    set al=%@replace[$T,&,%al]
    set al=%@replace[$*,%%$,%al]
    do p = 1 to 9
    set al=%@replace[$%p,%%%p,%al]
    enddo
    alias %al
    enddo
    setdos /x0

    -Scott

    "JP Software Forums" <neil@jpsoft.com> wrote on 11/14/2008 02:41:57 AM:


    /macrofile=aliases.dat"

    cmd.exe)

     

Share This Page