I want to do some stuffs on images with extensions defined in a variable. The following script run well:
set AllowExt="jpg png bmp"
forfiles /p D:\Pictures /m *.* /c "cmd /c if not %AllowExt:jpg=% == %AllowExt% echo @file
But the following script throws error
set AllowExt="jpg png bmp"
forfiles /p D:\Pictures /m *.* /c "cmd /c if not %AllowExt:@ext=% == %AllowExt% echo @file"
ERROR: Invalid argument/option - 'png'. Type "FORFILES /?" for usage.