Problem STOPPING TrustedInstaller.exe.

  1. Paul Black's Avatar
    Posts : 5,139
    Win 10 Pro 64-bit v1909 [Customised]
       #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 . . .
    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)
    However, if I end the TrustedInstaller.exe process in Task Manager and then run the script again, it WORKS!

    Although I DON'T want to delete the CBS folder, as a test, I also tried running . . .
    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)
    Again, this only WORKS if I end the TrustedInstaller.exe process in Task Manager and then run the script again.

    I also tried with the line . . .
    Code:
    net stop TrustedInstaller
    . . . 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!

    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; 4 Weeks Ago at 03:46.
      My Computer

  2. TairikuOkami's Avatar
    Posts : 4,163
    Home 2004 x64 10.0.19041.331
       #2

    Paul Black said:
    Again, this only WORKS if I end the TrustedInstaller.exe process in Task Manager
    So does not taskill work then?
    Code:
    taskkill /im trustedinstaller.exe /f
      My Computer

  3. Paul Black's Avatar
    Posts : 5,139
    Win 10 Pro 64-bit v1909 [Customised]
    Thread Starter
       #3

    Thanks for the reply @TairikuOkami, it is appreciated.

    TairikuOkami said:
    So does not taskill work then?
    Code:
    taskkill /im trustedinstaller.exe /f
    I am preparing to travel home today as I have been in lockdown at my Sister's for 10 weeks!
    I will try that later and get back to you.
    Thanks again!
      My Computer

  4. Paul Black's Avatar
    Posts : 5,139
    Win 10 Pro 64-bit v1909 [Customised]
    Thread Starter
       #4

    Hello @TairikuOkami,

    TairikuOkami said:
    Code:
    taskkill /im trustedinstaller.exe /f
    Brilliant!

    I changed it slightly to . . .

    Code:
    taskkill /im trustedinstaller.exe /f 1>nul 2>nul
      My Computer


 

Related Threads
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 09:56.
Find Us




Windows 10 Forums