0

When creating the following alias

DOSKEY echoall=FOR %p IN (*) DO echo %p

in CMD on Windows 10 the alias works as expected printing all the files in the directory. However I tried to define this makro in a separate makro definition file like described in this post. When trying to run the same makro then I get the error message

"p" cannot be processed syntactically at this point.

How can I resolve this so that %p actually gets substituted by the value like when defining the makro in the current cmd?

Madjosz
  • 111

2 Answers2

1

In a makro definition file the %p has to be escaped with an extra %. So the following will work:

DOSKEY echoall=FOR %%p IN (*) DO echo %%p
Madjosz
  • 111
0

Inside batch scripts you have to use 2 percentage signs instead of one in the normal command line