You need to add double quote around %1 to get the whole argument if it's a string.
@echo off :loop echo %1 shift if "%~1" neq "" goto :loop
When you run it you will see the result like this:
D:\2\test2>arg1 abc "abc def" abc "abc def"