I created an application in SCCM, which is initiated by a batch script - it launches MRT security scan - The computer on which I run the application is scanned successfully, the MRT also creates a success log but in the end in Software Center the application is visible as failed.
The application is in "installing" state untill the scan is finished, when the actions are finished it fails - it does not time out as the timeout is set to arround 500 minutes.
What I thought of is adding "exit /b 0" to give SCCM the "error 0" exit code - unfortunately no success.
The batch file has in it:
%SYSTEMROOT%\System32\mrt.exe /F:Y /Q
for /f "tokens=2 delims==" %%I in ('wmic os get localdatetime /format:list') do set datetime=%%I
set datetime=%datetime:~0,4%-%datetime:~4,2%-%datetime:~6,2%_%datetime:~8,2%-%datetime:~10,2%-%datetime:~12,2%
echo f | xcopy /f /y "%SYSTEMROOT%\Debug\"mrt.log "\\servername\log_folder\"%datetime%-%computername%scan.log
exit /b 0
Now when I look at the script - maybe I should put the MRT script in one batch and create a 2nd batch which would call the MRT scan script and on the end of this batch I should have the exit /b 0 ? What do you think?