I have a release pipeline task that runs a .bat file. This .bat file creates a Windows Process and Starts it. So this .bat file should run as an admin . How the TFS agent will run this .bat file as an admin? . The user that runs the VSTS agent has already admin rights on the machine and the process and vsts agent are on the same machine.
My .bat file
sc create PortalWinService binPath= "E:TestSitesPortalsrcPortal.exe"
sc failure PortalWinService actions= restart/60000/restart/60000/""/60000 reset= 86400
sc start PortalWinService
sc config PortalWinService start=auto