I've tried adding quotation marks around filepaths, and replacing quotation marks with 0x22. Also tried other variables and they all return the same kind of error. Tried one equal, two equals, all capitals... Everything looks right, but I don't understand why it's not working, would appreciate any help. Thanks.
set source=N:\Movies\
set target=M:\Movies\
forfiles /P "%source%" /C "cmd /c if @isdir==TRUE ( mklink /d 0x22%target%\@file\0x22 @path ) else ( mklink 0x22%target%\@file\0x22 @path )"
This is the error:
ERROR: Invalid argument/option – '@isdir==TRUE'.