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

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -