ok going to go slow with these changes ... Version 1.7 is available.

Added the /ENV switch - this substitutes the callers environment (variables) into the callee's environment (variables). Similiar to the way Microsoft's runas does (although I'm not too sure if the ms /env also substitues HKCU or not, will have to test that).

Encoding environment variables into the token file needs a bit more work and testing.

"Thinking about" the other change now - token substitution ... need more thought on that one.

Not sure if these changes are moving things along in the direction that will help you out or not - please advise.

[edit]

It appears the ms runas /env just substitutes environment vars.