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

Why can rails not find a route created by a helper? -

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -