If you’re running within a batch/cmd file, you need to double the % markers:
for %%i in (*.txt *.doc) do copy %%i c:\test2
The single % variant only works from the command line.
If you’re running within a batch/cmd file, you need to double the % markers:
for %%i in (*.txt *.doc) do copy %%i c:\test2
The single % variant only works from the command line.