'Script to  Install AssetExplorer Agent
'======================================

'To install agent with the share path given as argument
'===================================================================

On Error Resume Next
Set WSHShell = WScript.CreateObject("WScript.Shell")

argCount = WScript.Arguments.Count

if (argCount>5) then
	' Get Location and arguments of the script
	msiFile = WSCript.Arguments.Item(0)
	PROTOCOL = WSCript.Arguments.Item(1)
	SERVERIP = WSCript.Arguments.Item(2)
	SERVERNAME = WSCript.Arguments.Item(3)
	PORT = WSCript.Arguments.Item(4)
	AGENTPORT = WSCript.Arguments.Item(5)
	wshshell.Run "msiexec.exe /i """&msiFile&""" ENABLESILENT=yes REBOOT=ReallySuppress PROTOCOL="&PROTOCOL&" SERVERIP="&SERVERIP&" SERVERNAME="&SERVERNAME&" PORT="&PORT&" AGENTPORT="&AGENTPORT&" /qn",0,True
end if

