'UAC virtualization is now allowed when register jenkins as service on Windows10

I've used winsw to register my jenkins slave as a service on my windows10 and then I found that because UAC virtualization is set to "not allowed" on every child process that was triggered by jenkins, my task just hung forever.

Then I tried starting up my slave manually (via running bat), those tasks that used to hang worked with UAC virtualization set to "disabled"

And both of the methods above were logged in as the same user.

I did a bit research online, I just couldn't find ways to register jenkins as a service without hanging my tasks, how can I fix this?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source