Your problem is not the space in the name of the file. Your problem is that you are typing the name of the file with quotes, quotes that are stored in the variable, and then placing aditional quotes in the for
command.
SET /p "infile=enter file"
set "infile=%infile:"=%"
Echo you're file is %infile%
Ensure there are no aditional quotes in the filename and this error will not happen (or don't use quotes when typing the name of the file)