batch file - What is causing this forfiles error? -


i'm running in batch file:

forfiles /p "%~dp0" /c "echo @file"

and when run it, error:

c:\users\zach\desktop\new folder>forfiles /p "c:\users\zach\desktop\new folder\" /c "echo @file" error: invalid argument/option - '@file'. type "forfiles /?" usage. 

what's problem @file?

%~dp0 includes tailing backslash. , causing problems (this , monacraft points)

so, change code

forfiles /p "%~dp0." /c "cmd /c echo @file" 

Comments

Popular posts from this blog

hibernate - How to load global settings frequently used in application in Java -

python 3.x - Mapping specific letters onto a list of words -

objective c - Ownership modifiers with manual reference counting -