Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Expand all aliases on the command line

Aug
1,917
68
Code:
     _x64: 1
   _admin: 1
_elevated: 1

TCC  25.00.20 x64   Windows 10 [Version 10.0.18362.356]

I have the following aliases;
Code:
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;
Code:
vbs64 math.vbs
...and expand it on the command line by pressing Ctrl-W...
Code:
e:\utils>%@if[1 eq 0,dir *.vbs,cscript64 //nologo] math.vbs
...why is the cscript64 alias not expanded?

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

Similar threads

Back
Top