This might have been answered before, but I was unable to find a clear answer to my specific issue.
I'm trying to run a batch-script that will trigger installation of a custom written Windows Service written with Topshelf using .Net Framework.
I can install the service by calling the executable with an install startup flag appended to it from a batch file. This will install the service and run it as local system within a Windows Service.
I can run this batch script as administrator directly just fine, but it will not work when I try to use it within the context of a startup script in Group Policy Objects (GPO). This is because the start script runs the batch file within the context of the SYSTEM account. And this account enviorement does not see the .Net framework properly, causing the installation to fail due to missing .DLL files.
Here is the batch script i'm running:
@echo off
:: Check for previously installed probing agent.
if exist C:\vnc-probe-agent ( goto EXIT
) else ( goto INSTALL_AGENT
)
:INSTALL_AGENT
mkdir C:\vnc-probe-agent
xcopy /s /v /y \\SERVER\Apps\vnc-probing-agent C:\vnc-probe-agent
cd C:\vnc-probe-agent
timeout 3
C:\vnc-probe-agent\vnc-probe-agent.exe install
C:\vnc-probe-agent\vnc-probe-agent.exe start
timeout 30
:EXITAnyone have any clever tricks to run this script as BUILTIN\Administrator instead of SYSTEM?
I have tried to use Task Scheduler as well, but this also did not work. It flat out refused to create the task scheduler entry at all with the required settings.
1 Reset to default