New
#1
Problem STOPPING TrustedInstaller.exe.
I have a script that runs SFC etc.
After SFC has finished running, if I run SFC again, it DOESN'T delete the two files in the CBS folder using the code below . . .
However, if I end the TrustedInstaller.exe process in Task Manager and then run the script again, it WORKS!Code:if exist "%windir%\Logs\CBS\CBS_ERRORS.txt" (del /s /f /q "%windir%\Logs\CBS\CBS_ERRORS.txt" >nul 2>&1) if exist "%windir%\Logs\CBS\CBS.log" (del /s /f /q "%windir%\Logs\CBS\CBS.log" >nul 2>&1)
Although I DON'T want to delete the CBS folder, as a test, I also tried running . . .
Again, this only WORKS if I end the TrustedInstaller.exe process in Task Manager and then run the script again.Code:if exist "%windir%\Logs\CBS" (del /s /f /q "%windir%\Logs\CBS" >nul 2>&1) if exist "%windir%\Logs\CBS" (rmdir /s /q "%windir%\Logs\CBS" >nul 2>&1)
I also tried with the line . . .
. . . at the beginning of BOTH of the above but for some reason it seemed to hang on the stopping process with an ever increasing line of dots in the cmd prompt!Code:net stop TrustedInstaller
Thanks in advance.
UPDATE:
It may be the fact that I need to leave it for several minutes before running the script again with the net stop TrustedInstaller.exe line at the beginning of the first code above!
I will further investigate this theory later.
Last edited by Paul Black; 03 Jun 2020 at 03:46.