Enviado em 03/08/2018 - 15:30h
Ola pessoal. Preciso de uma ajuda.wmic OS get OSArchitecture | findstr /i "64" > nul
IF %ERRORLEVEL% EQU 1 goto install32
IF %ERRORLEVEL% EQU 0 goto install64
:install32
if not exist "c:\Arquivos de programas\OCS Inventory Agent\OcsService.exe" goto install
reg export "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OCS Inventory NG Agent" C:\Windows\Temp\temp1.txt
type c:\windows\temp\temp1.txt |find "DisplayVersion" >> c:\windows\temp\temp2.txt
type c:\windows\temp\temp2.txt |findstr /i "2.1.1.1" > nul
del c:\windows\temp\temp1.txt c:\windows\temp\temp2.txt
IF %ERRORLEVEL% EQU 1 goto install
goto install
:install64
if not exist "c:\Program Files (x86)\OCS Inventory Agent\OcsService.exe" goto install
reg export "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\OCS Inventory NG Agent" C:\Windows\Temp\temp1.txt
type c:\windows\temp\temp1.txt |find "DisplayVersion" >> c:\windows\temp\temp2.txt
type c:\windows\temp\temp2.txt |findstr /i "2.1.1.1" > nul
del c:\windows\temp\temp1.txt c:\windows\temp\temp2.txt
IF %ERRORLEVEL% EQU 1 goto install
goto install
:install
start \\gowacd01\netlogon\Ocs\OCS-NG-Windows-Agent-Setup.exe /S /SERVER:http://192.168.1.12/ocsinventory /nosplash /notag /DEBUG /INSTALL /now /nocert
xcopy \\gowacd01\netlogon\Ocs\OCS-NG-Windows-Agent-Setup.exe C:\Windows\Temp /Y
xcopy \\gowacd01\netlogon\Ocs\OcsLogon.exe C:\Windows\Temp /Y
start C:\Windows\Temp\OCS-NG-Windows-Agent-Setup.exe /S
start C:\Windows\Temp\OcsLogon.exe /nosplash /notag /DEBUG /INSTALL /now /nocert
goto exit
:exit
Exec "${OCS_EXEC_FILE}"
exit