@echo off
SETLOCAL EnableDelayedExpansion

rem In elevated case, the current directory is not where the batch file is.
rem Switch to where the script is first.
chdir %~dp0

copy /Y "AgentRemoval\AgentStop.bat" c:\
if ERRORLEVEL 1 (
	echo --------------------------------------------------------
	echo --------------------------------------------------------
	echo --------------------------------------------------------
	echo Please run this script with Administrator privilege!!
	echo --------------------------------------------------------
	echo --------------------------------------------------------
	echo --------------------------------------------------------
	pause
	goto :EOF
) else (
	del /f /q c:\AgentStop.bat
)

set TIMESTAMP=
for /F "tokens=1,2,3 delims=:." %%a in ("%TIME%") do (
    set TIMESTAMP=%%a_%%b_%%c
)

echo Log file "Uninstall.%TIMESTAMP%.log" is created.
set AGENT_DISABLE_SVC=0
call AgentRemoval\AgentStop.bat >> "Stop.%TIMESTAMP%.log" 2>>&1

:EOF