I am running a Windows 10 virtual machine on Azure. I have deployed my application using simple copy file approach (not MSI). After which, i am successfully creating the service using SC.exe as follows:
sc create "VNCServer.Service" binPath="C:\server\VNCServer.exe"
net start "VNCServer.Service"
sc config "VNCServer.Service" start= auto
Everything works as expected for weeks (including many reboots) until the next Windows update is taken. After taking the Windows update, the service appears to have been deleted. I need to rerun the script above to create the service each time a windows update occurs.
What is happening here? What can I do?