Hi Dave,
What version of VCD are you running? It's better to always mention that since there are differences between implementations. I believe in 1.5 both pre- and post-customization script were executed from the context of Tools Service. By default it is "NT Authority\System". To confirm just run something like:
if "%1%" == "precustomization" (
whoami >> C:\pre.txt
) else if "%1%" == "postcustomization" (
whoami >> C:\post.txt
)
You can change Tools Service's account to say local Administrator and that should change output of the above.
In 5.1 I changed post-customization to run after the last reboot in most cases. That was needed in order for folks to plug their own hooks and know when customization is "done". It's implemented using Windows Task Scheduler. Now I believe the task is currently always executed as "SYSTEM", meaning that you would always get "NT Authority\System" in post.txt. And I've also seen some weird behavior related to the context stuff with other things like KMS activation.
I just had an idea - could you try to run your experiments using pre-customization together with changing Tools Service's account? If that works for you, I can think how to provide the same possiblity for post-customization going forward.
/Andrii