Trusted-CMD/TI-CMD.bat

36 lines
988 B
Batchfile
Raw Permalink Normal View History

2025-02-13 22:15:52 +00:00
:: Trusted-CMD
:: Made by Sneed Group with love.
:: Licensed under the MIT license.
2025-02-13 22:07:07 +00:00
@echo off
2025-02-13 22:15:04 +00:00
:: Info and 1337 ha0xr colors
2025-02-13 22:07:07 +00:00
title TrustedInstaller CMD
color 0a
2025-02-13 22:15:04 +00:00
echo TrustedInstaller CMD is made by Sneed Group.
echo "Output stored at C:\ticmd-out.txt"
2025-02-13 22:07:07 +00:00
:A
2025-02-13 22:15:04 +00:00
:: Allow user input
2025-02-13 22:07:07 +00:00
set /p bp="TI:\> "
2025-02-13 22:15:04 +00:00
:: For sanity: Stop TrustedInstaller service before modifying it
2025-02-13 22:07:07 +00:00
sc.exe stop TrustedInstaller
2025-02-13 22:15:04 +00:00
:: Run user input as TrustedInstaller, output to plaintext file
sc.exe config TrustedInstaller binpath= "cmd /c %bp% >> C:\ticmd-out.txt"
:: Start TrustedInstaller with new configuration
2025-02-13 22:07:07 +00:00
sc.exe start TrustedInstaller
2025-02-13 22:15:04 +00:00
:: Stop to reconfigure to defaults
sc.exe stop TrustedInstaller
sc.exe config TrustedInstaller binpath= "%windir%\servicing\TrustedInstaller.exe"
:: Restart loop
2025-02-13 22:07:07 +00:00
goto A
2025-02-13 22:15:04 +00:00
:: In case the user somehow exits the loop, reset the TrustedInstaller service back to default
sc.exe stop TrustedInstaller
sc.exe config TrustedInstaller binpath= "%windir%\servicing\TrustedInstaller.exe"