mvdw -
Why not use VNC or Net Meeting to take complete control of the Desktop, then perform normal Windows logoff from there?
Also, if files are 'locked', likely due to process running, so you could also try remotely killing process(es).

Interested in seeing/learning the script you are working on - I take in one goal is manipulate system at command level without end-user knowledge? Also, are you really running RCMD service on every WinNT system?

Bill