Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I remove quotes from forfiles variable fname

Can anyone explain me how to do this?

Problem is @fname contains quotes so concatting %source% and @fname gives an error...

forfiles /P "%source%" /M %file%.* /D -1 /C "cmd /c if exists %source%\@fname.pdf del @path"
like image 764
grmbl Avatar asked Dec 13 '25 03:12

grmbl


1 Answers

The double quotes are not the issue. You've got a syntax error in your command line: instead of if exists … it should go if exist.

like image 163
Andriy M Avatar answered Dec 14 '25 17:12

Andriy M