Page 1 of 1

Run cmd.exe as trustedinstaller

Posted: 13 Jun 2015, 10:19
by MagicAndre1981
What do I have to enter under "Run As" to run cmd.exe as TrustedInstaller?

I need it to extract files from WinSxS to move them again into a .CAB file. This script only works when I run it as trustedinstaller. I used DevxExec, but in Win8.x it fails to run the tool as trustedinstaller (error 0xc0000142). I found a workaround by running DevxExec under Depends.exe (Tracing mode with F7), but this is annoying.

Re: Run cmd.exe as trustedinstaller

Posted: 14 Jun 2015, 08:59
by wj32
If you can get something else to run as TrustedInstaller, right-click that process and choose Miscellaneous > Run As This User.

Re: Run cmd.exe as trustedinstaller

Posted: 14 Jun 2015, 18:14
by MagicAndre1981
I don't understand what you mean. Here I can launch a program with system rights easily when I select a service, but I need trustedinstaller.

Re: Run cmd.exe as trustedinstaller

Posted: 14 Jun 2015, 23:47
by wj32
Rather than selecting a service, select a process that is running as TrustedInstaller. Usually there are no such processes, so you'll have to make one appear by running Windows Update or installing a msi.

Re: Run cmd.exe as trustedinstaller

Posted: 15 Jun 2015, 04:21
by MagicAndre1981
nope, this launches the programs as SYSTEM, not TrsutedInstaller.

Re: Run cmd.exe as trustedinstaller

Posted: 15 Jun 2015, 04:33
by wj32
Are you sure you selected "Run As This User", not "Run As"? The user name field should be disabled. Did you make sure the TrustedInstaller process was still running by the time PH tried to start cmd? You can try suspending it.

Re: Run cmd.exe as trustedinstaller

Posted: 15 Jun 2015, 17:20
by MagicAndre1981
yes, I'm sure. TrustedInstaller.exe/TiWorker.exe run as SYSTEM, so using "Run As This User" runs the program as system and not trustedinstaller.

Re: Run cmd.exe as trustedinstaller

Posted: 15 Jun 2015, 21:01
by wj32
No, I didn't mean TrustedInstaller.exe. I meant a process that is running under the TrustedInstaller user account.

Re: Run cmd.exe as trustedinstaller

Posted: 16 Jun 2015, 04:27
by MagicAndre1981
there is no other process running as TrustedInstaller

Re: Run cmd.exe as trustedinstaller

Posted: 16 Jun 2015, 05:56
by wj32
That's why you need to start one somehow.

Re: Run cmd.exe as trustedinstaller

Posted: 17 Jun 2015, 04:09
by MagicAndre1981
yeah, but this is what I want to achieve with ProcessHacker ...

Re: Run cmd.exe as trustedinstaller

Posted: 17 Jun 2015, 04:48
by wj32
In Windows 8 is TrustedInstaller a user, or does it just need to appear in the process token in order to achieve what you want? Maybe you could modify PH's code to call NtCreateToken and use that when starting the process.

Re: Run cmd.exe as trustedinstaller

Posted: 20 Jun 2015, 08:38
by MagicAndre1981
ok, got it. Your thought was correct. I have to use "Run as this user" and select the TiWorker/TrustedInstaller.exe. Here I get what I need for the cmd.exe: "NT SERVICE\TrustedInstaller, Owner (Default Enabled)" .


So, can you please add trustedinstaller as item to the RunAs dialog which does this:

1- look if Trustedinstaller is running and if not start the trusted installer service
2- call Run As this user and use the TiWorker/TrustedInstaller.exe
3- if TrustedInstaller was not running stop it again otherwise leave it running

Re: Run cmd.exe as trustedinstaller

Posted: 20 Jun 2015, 09:14
by wj32
I think it might be even better to have a custom token creation dialog where you can choose which groups you want to add to the token :P

Re: Run cmd.exe as trustedinstaller

Posted: 31 Jan 2016, 08:45
by MagicAndre1981
wj32 wrote:
I think it might be even better to have a custom token creation dialog where you can choose which groups you want to add to the token :P
if you have the time to add it, this would be awesome

Re: Run cmd.exe as trustedinstaller

Posted: 18 Jul 2016, 14:08
by viddkideo
You lost me at Miscellaneous > Run As This User
and find TiWorker/trustedinstaller.exe

what context menu has that available? what do I edit to add those options?

Re: Run cmd.exe as trustedinstaller

Posted: 19 Jul 2016, 12:33
by viksoftru
I see. :) Just press Apps button on selected process and see screen:
2.png
v3.0.0.144

Re: Run cmd.exe as trustedinstaller

Posted: 12 Aug 2016, 16:56
by dmex
Trusted Installer Plugin:
viewtopic.php?t=2407

Image

Re: Run cmd.exe as trustedinstaller

Posted: 13 Aug 2016, 18:47
by MagicAndre1981
awesome, it works fine. thanks :)