How do you run that script inside the VM's guest OS? Via Invoke-VMScript?
Do you get any error messages?
Sorry for the late update. I just tested it directly running inside guest as batch file.
As I run, it just pulls out code on the command prompt and then just gets back to prompt without any errors. But the registry entry remain without any modification.
Is there any other efficient methods to get this done?
Can you try changing that last line to
That way you should see the eventual feedback from the regedit command.
I will test this and update