command order

Oct 18, 2008
302
1
Hello --

If i set the env vars

set .foo=foocmd.exe
set .bar=foocmd.exe

Can I control the order that anything.foo or anything.bar get executed by adding .foo and .bar to the pathext env variable?

THanks
 
May 20, 2008
10,511
77
Syracuse, NY, USA
I think so. I tried it with a BTM instead of an EXE.
Code:
v:\> type foocmd.btm
echo Called as %0 %1

v:\> set .*
.bar=foocmd.btm
.foo=foocmd.btm

v:\> eset pathext
PATHEXT=.foo;.bar;.BTM;.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.py;.pyw

v:\> anything
Called as foocmd.btm V:\anything.foo

v:\> eset pathext
PATHEXT=.bar;.foo;.BTM;.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.py;.pyw

v:\> anything
Called as foocmd.btm V:\anything.bar