In AutoCAD, you can use spaces in all prompts for name (filename, folder, layer, dimension, style, font).
However, if you enter a name at the prompt in a commandline version of a command from a running script (.SCR), the space in the name is interpreted as an end-of-line, new line, Enter.
If you need to use a space in a name entered through a script, enter the name enclosed in double-quotes, i.e. "my name" - e.g. "C:\My folder\My file.dwg" or "My layer" or "My font".
Check also your setting of the EXTNAMES variable (should be 1).
This tip applies both to script files run through the command SCRIPT, and to scripts entered through AutoCAD or AutoCAD LT runstrings, and also to scripts used in the AcCoreConsole.exe console.