Neither WinSCP nor PuTTY provide a way to automate the 2FA authentication.
And even if they did, a question is whether the system that provides you the code (which you didn't tell us anything about) would allow you to obtain it automatically. It would kind of defy its purpose.
Quoting the documentation:
The -m option performs a similar function to the ‘Remote command’ box in the SSH panel of the PuTTY configuration box (see section 4.18.1). However, the -m option expects to be given a local file name, and it will read a command from that file.
And quoting section 4.18.1:
In SSH, you don't have to run a general shell session on ...