Put the second parameter in double quotes when calling the batch script.
In the batch script use %~2 to reference the second parameter without the quotes.
If you want to use double quotes inside the quoted parameter, duplicate the quote character. With the dequoting in the batch script duplicated quotes are removed too, AFAIK.
Here's a simple script illustrating the idea:
@ECHO OFF
ECHO %1 %2
ECHO %~1 %~2
Now call it like this:
mybatch.bat username "hello this is text"
and see the result:
username "hello this is text"
username hello this is text
That is, when you use %i to reference a parameter, the quotes, if there are any, are retained, but %~i effectively removes them for you.
And, as you can see from %~1 use, if there are no quotes, the output is just the same as with %1, so you don't need to always include quotes simply to justify the tilde use.