Is this a logon script or startup script?

It sounds like it might be a startup script. If this is the case the script is running as SYSTEM. You have a couple of options...

1. Create a hybrid startup and login script. Startup for admin things, and logon for user related things.
2. There is RunAsInteractiveUser. This is a UDF that has been pretty thoroughly tested by the kixtart community.

There is another way that involves a registry hack, but I'm not going to advise you go that direction.

RunAsInteractiveUser -
http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=198514#Post198514
(go to the bottom of thread to get most current version)

How to use UDFs -
http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=81943#Post81943

The rest of the UDFs are here -
http://www.kixtart.org/forums/ubbthreads.php?ubb=postlist&Board=7&page=1