A properly configured line could be
code:
$shellcommand='"'+$MAPILOC+'\PROFGEN.EXE" "'+$MAPILOC+'\NEWPROF.EXE" -P "'+$USERPROFDir+'\'+@userid+'.PRF" -R -T "'+$USERPROFDir+'"'
? 'SHELL command = '+$shellcommand
shell '%COMSPEC% /c /e:1024 '+$shellcommand

This way you can double-check that all quotes are set properly.
_________________________
There are two types of vessels, submarines and targets.