I have mini recursive function which finds and hides all .mta files. It looks like that
For /r %1 in (*.mta) do attrib +h "%1"
When i’m trying to execute it from command Prompt manually, it works properly

I’ve created .bat file. The code looks like that
D:
For /r %1 in (*.mta) do attrib +h "%1"
pause
Tried to execute this file. Gettin’ this screen

What’s wrong with the code?
Try with:
(And name your file
.cmd, it looks more modern.)Don’t use
%1, that refers to your script’s arguments, so it will not work. Use%at the command line and%%in batch scripts.