Expand all aliases on the command line

     _x64: 1
   _admin: 1
_elevated: 1

TCC  25.00.20 x64   Windows 10 [Version 10.0.18362.356]

I have the following aliases;
e:\utils>alias cscript64
C:\Windows\system32\cscript.exe //nologo %$

e:\utils>alias vbs64
%@if[%# eq 0,dir *.vbs,cscript64]

If I run the command;
vbs64 math.vbs
...and expand it on the command line by pressing Ctrl-W...
e:\utils>%@if[1 eq 0,dir *.vbs,cscript64 //nologo] math.vbs
...why is the cscript64 alias not expanded?

Ctrl- W only expands aliases at the beginning of the command line or following a command separator.

To expand aliases inside an @IF would require the command line editor to execute the command line and evaluate the result. That's outside the editor's scope, and would introduce a host of new problems.
  • Like
Reactions: nikbackm

Similar threads