Interestingly (and perhaps predictably), it doesn't go back to the desktop if you have deliberately locked the desktop with the lock command. In that case it stays locked.

This only works if you've logged in via remote desktop, either left the RDP session open or closed it with the close button, and then you execute those commands on the machine.

Fortunately this was exactly the use-case I was trying to fix, so it works for me for now and produces the desired result.

Now on to the next step which is to see if it actually fixes the problem I was having. That's a task for tomorrow.
_________________________
Tony Fabris