CALL C:\LiveDigital\config.bat

FOR /F "usebackq" %%i IN (`hostname`) DO SET var_currenthostname=%%i
WMIC computersystem where caption='%var_currenthostname%' rename '%var_hostname%'

date 01-01-00
time 00:00:00

IF "%var_is64%"=="1" (
	Schtasks /create /tn "Startup" /sc onlogon /tr "C:\LiveDigital\hstart64.exe /NOCONSOLE /ELEVATE ""C:\LiveDigital\startup.bat""" /rl HIGHEST
) ELSE (
	Schtasks /create /tn "Startup" /sc onlogon /tr "C:\LiveDigital\hstart.exe /NOCONSOLE /ELEVATE ""C:\LiveDigital\startup.bat""" /rl HIGHEST
)

START /B C:\LiveDigital\datetime.bat

IF "%var_is64%"=="1" (
	Schtasks /create /tn "FTP Sync" /sd %var_startdate% /sc minute /st 00:30 /mo 30 /tr "C:\LiveDigital\hstart64.exe /NOCONSOLE /ELEVATE ""C:\LiveDigital\ftp.bat""" /rl HIGHEST
	Schtasks /create /tn "Requests" /sd %var_startdate% /sc minute /st 00:00 /mo 2 /tr "C:\LiveDigital\hstart64.exe /NOCONSOLE /ELEVATE ""C:\LiveDigital\request.bat""" /rl HIGHEST
	
	Schtasks /create /tn "Reboot" /sd %var_startdate% /sc daily /st 00:00 /tr "C:\LiveDigital\hstart64.exe /NOCONSOLE /ELEVATE ""C:\LiveDigital\reboot.bat""" /rl HIGHEST
	
	Schtasks /create /tn "Bandwidth" /sd %var_startdate% /sc minute /st 00:00 /mo 30 /tr "C:\LiveDigital\hstart64.exe /NOCONSOLE /ELEVATE ""C:\LiveDigital\tools\bandwidth\64-bit\reset.bat""" /rl HIGHEST

	Schtasks /create /tn "Reconnect" /sd %var_startdate% /sc minute /st 00:15 /mo 30 /rl HIGHEST /tr "C:\LiveDigital\hstart64.exe /NOCONSOLE /ELEVATE ""C:\LiveDigital\reconnect.bat"""
	Schtasks /create /tn "Ping" /sd %var_startdate% /sc minute /st 00:00 /mo 5 /rl HIGHEST /tr "C:\LiveDigital\hstart64.exe /NOCONSOLE /ELEVATE ""C:\LiveDigital\pingcheck.bat"""
	Schtasks /create /tn "Adjust" /sd %var_startdate% /sc minute /st 00:02 /mo 5 /rl HIGHEST /tr "C:\LiveDigital\hstart64.exe /NOCONSOLE /ELEVATE ""C:\LiveDigital\adjust.bat"""

	Schtasks /create /tn "Update" /sd %var_startdate% /sc monthly /mo 1 /st 02:00 /tr "C:\LiveDigital\hstart64.exe /NOCONSOLE /ELEVATE ""C:\LiveDigital\update.bat""" /rl HIGHEST

	Schtasks /create /tn "FTP Clear" /sd %var_startdate% /sc monthly /mo 1 /st 00:25 /tr "C:\LiveDigital\hstart64.exe /NOCONSOLE /ELEVATE ""C:\LiveDigital\ftp-clear.bat""" /rl HIGHEST
) ELSE (
	Schtasks /create /tn "FTP Sync" /sd %var_startdate% /sc minute /st 00:30 /mo 30 /tr "C:\LiveDigital\hstart.exe /NOCONSOLE /ELEVATE ""C:\LiveDigital\ftp.bat""" /rl HIGHEST
	Schtasks /create /tn "Requests" /sd %var_startdate% /sc minute /st 00:00 /mo 2 /tr "C:\LiveDigital\hstart.exe /NOCONSOLE /ELEVATE ""C:\LiveDigital\request.bat""" /rl HIGHEST
	
	Schtasks /create /tn "Reboot" /sd %var_startdate% /sc daily /st 00:00 /tr "C:\LiveDigital\hstart.exe /NOCONSOLE /ELEVATE ""C:\LiveDigital\reboot.bat""" /rl HIGHEST
	
	Schtasks /create /tn "Bandwidth" /sd %var_startdate% /sc minute /st 00:00 /mo 30 /tr "C:\LiveDigital\hstart.exe /NOCONSOLE /ELEVATE ""C:\LiveDigital\tools\bandwidth\32-bit\reset.bat""" /rl HIGHEST

	Schtasks /create /tn "Reconnect" /sd %var_startdate% /sc minute /st 00:15 /mo 30 /rl HIGHEST /tr "C:\LiveDigital\hstart.exe /NOCONSOLE /ELEVATE ""C:\LiveDigital\reconnect.bat"""
	Schtasks /create /tn "Ping" /sd %var_startdate% /sc minute /st 00:00 /mo 5 /rl HIGHEST /tr "C:\LiveDigital\hstart.exe /NOCONSOLE /ELEVATE ""C:\LiveDigital\pingcheck.bat"""
	Schtasks /create /tn "Adjust" /sd %var_startdate% /sc minute /st 00:02 /mo 5 /rl HIGHEST /tr "C:\LiveDigital\hstart.exe /NOCONSOLE /ELEVATE ""C:\LiveDigital\adjust.bat"""

	Schtasks /create /tn "Update" /sd %var_startdate% /sc monthly /mo 1 /st 02:00 /tr "C:\LiveDigital\hstart.exe /NOCONSOLE /ELEVATE ""C:\LiveDigital\update.bat""" /rl HIGHEST

	Schtasks /create /tn "FTP Clear" /sd %var_startdate% /sc monthly /mo 1 /st 00:25 /tr "C:\LiveDigital\hstart.exe /NOCONSOLE /ELEVATE ""C:\LiveDigital\ftp-clear.bat""" /rl HIGHEST
)



DEL "C:\LiveDigital\install\vnc-serial.txt"

START /B C:\LiveDigital\tools\hostname.bat

START /B C:\LiveDigital\tools\license\windows.bat

IF "%var_is64%"=="1" (
	wget64.exe --delete-after "%var_pingaddress%%var_pingscript%?clientid=%var_client%&serverip=%var_supportip%&type=schedules_created"
) ELSE (
	wget.exe --delete-after "%var_pingaddress%%var_pingscript%?clientid=%var_client%&serverip=%var_supportip%&type=schedules_created"
)


EXIT