Run cmd.exe as trustedinstaller

General discussion for support or help requests
Post Reply
User avatar
MagicAndre1981
Member
Posts: 230
Joined: 22 Nov 2011, 12:02
OS: Windows 8Pro(x64) with Win7 UI

Run cmd.exe as trustedinstaller

Post 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.

User avatar
wj32
Founder
Posts: 948
Joined: 17 Jan 2011, 05:19
OS: Windows
Location: Australia
Contact:

Re: Run cmd.exe as trustedinstaller

Post by wj32 »

If you can get something else to run as TrustedInstaller, right-click that process and choose Miscellaneous > Run As This User.

User avatar
MagicAndre1981
Member
Posts: 230
Joined: 22 Nov 2011, 12:02
OS: Windows 8Pro(x64) with Win7 UI

Re: Run cmd.exe as trustedinstaller

Post 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.

User avatar
wj32
Founder
Posts: 948
Joined: 17 Jan 2011, 05:19
OS: Windows
Location: Australia
Contact:

Re: Run cmd.exe as trustedinstaller

Post 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.

User avatar
MagicAndre1981
Member
Posts: 230
Joined: 22 Nov 2011, 12:02
OS: Windows 8Pro(x64) with Win7 UI

Re: Run cmd.exe as trustedinstaller

Post by MagicAndre1981 »

nope, this launches the programs as SYSTEM, not TrsutedInstaller.

User avatar
wj32
Founder
Posts: 948
Joined: 17 Jan 2011, 05:19
OS: Windows
Location: Australia
Contact:

Re: Run cmd.exe as trustedinstaller

Post 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.

User avatar
MagicAndre1981
Member
Posts: 230
Joined: 22 Nov 2011, 12:02
OS: Windows 8Pro(x64) with Win7 UI

Re: Run cmd.exe as trustedinstaller

Post 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.

User avatar
wj32
Founder
Posts: 948
Joined: 17 Jan 2011, 05:19
OS: Windows
Location: Australia
Contact:

Re: Run cmd.exe as trustedinstaller

Post by wj32 »

No, I didn't mean TrustedInstaller.exe. I meant a process that is running under the TrustedInstaller user account.

User avatar
MagicAndre1981
Member
Posts: 230
Joined: 22 Nov 2011, 12:02
OS: Windows 8Pro(x64) with Win7 UI

Re: Run cmd.exe as trustedinstaller

Post by MagicAndre1981 »

there is no other process running as TrustedInstaller

User avatar
wj32
Founder
Posts: 948
Joined: 17 Jan 2011, 05:19
OS: Windows
Location: Australia
Contact:

Re: Run cmd.exe as trustedinstaller

Post by wj32 »

That's why you need to start one somehow.

User avatar
MagicAndre1981
Member
Posts: 230
Joined: 22 Nov 2011, 12:02
OS: Windows 8Pro(x64) with Win7 UI

Re: Run cmd.exe as trustedinstaller

Post by MagicAndre1981 »

yeah, but this is what I want to achieve with ProcessHacker ...

User avatar
wj32
Founder
Posts: 948
Joined: 17 Jan 2011, 05:19
OS: Windows
Location: Australia
Contact:

Re: Run cmd.exe as trustedinstaller

Post 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.

User avatar
MagicAndre1981
Member
Posts: 230
Joined: 22 Nov 2011, 12:02
OS: Windows 8Pro(x64) with Win7 UI

Re: Run cmd.exe as trustedinstaller

Post 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

User avatar
wj32
Founder
Posts: 948
Joined: 17 Jan 2011, 05:19
OS: Windows
Location: Australia
Contact:

Re: Run cmd.exe as trustedinstaller

Post 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

User avatar
MagicAndre1981
Member
Posts: 230
Joined: 22 Nov 2011, 12:02
OS: Windows 8Pro(x64) with Win7 UI

Re: Run cmd.exe as trustedinstaller

Post 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

viddkideo

Re: Run cmd.exe as trustedinstaller

Post 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?

User avatar
viksoftru
Member
Posts: 618
Joined: 15 Aug 2011, 06:01
OS: Win7 (Live! DVD), BSD
Location: Russia

Re: Run cmd.exe as trustedinstaller

Post by viksoftru »

I see. :) Just press Apps button on selected process and see screen:
2.png
v3.0.0.144

User avatar
dmex
Admin
Posts: 1517
Joined: 17 Jan 2011, 05:43

Re: Run cmd.exe as trustedinstaller

Post by dmex »

Trusted Installer Plugin:
viewtopic.php?t=2407

Image

User avatar
MagicAndre1981
Member
Posts: 230
Joined: 22 Nov 2011, 12:02
OS: Windows 8Pro(x64) with Win7 UI

Re: Run cmd.exe as trustedinstaller

Post by MagicAndre1981 »

awesome, it works fine. thanks :)

Post Reply