Not off hand, have you tried tracing-out (displaying-out) the values to the console during a test, so that you can see what things are pointing to ? ...

? "%userprofile%"
? "Hit any key..." GET$

Have you tried using this:

?"ERROR @ERROR - @SERROR"
? "Hit any key..." GET$

after your problem statements, to see whats going on under-the-covers ?

-Shawn