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

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

javascript - jquery or ashx not working -

inno setup - TLabel or TNewStaticText - change .Font.Style on Focus like Cursor changes with .Cursor -