Cmd.exe's doskey campatibility

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
Nov 13, 2008
17
0
#1
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.
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,384
39
Albuquerque, NM
prospero.unm.edu
#2
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).
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.
 
#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
 

samintz

Scott Mintz
May 20, 2008
1,203
11
Solon, OH, USA
#5
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:


> 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.
>
>
>
>