{"id":2334,"date":"2017-02-22T07:38:27","date_gmt":"2017-02-22T06:38:27","guid":{"rendered":"http:\/\/borncity.com\/win\/?p=2334"},"modified":"2022-06-23T21:03:00","modified_gmt":"2022-06-23T19:03:00","slug":"windows-10-execute-programs-as-systemtrustedinstaller","status":"publish","type":"post","link":"https:\/\/borncity.com\/win\/2017\/02\/22\/windows-10-execute-programs-as-systemtrustedinstaller\/","title":{"rendered":"Windows 10: Execute programs as System\/TrustedInstaller"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" style=\"float: left; margin: 0px 10px 0px 0px; display: inline\" src=\"http:\/\/www.borncity.com\/blog\/wp-content\/uploads\/2015\/01\/win102.jpg\" width=\"58\" align=\"left\" height=\"58\">[<a href=\"http:\/\/www.borncity.com\/blog\/2016\/10\/27\/tipp-programme-mit-trustedinstaller-privilegien-ausfhren\/\" target=\"_blank\" rel=\"noopener noreferrer\">German<\/a>]In some cases it could be helpful to execute programs as System or Trusted Installer to avoid access denied conflicts. This blog post introduces two solutions for Windows 10. <\/p>\n<p><!--more--><\/p>\n<h3>What's the problem?<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" src=\"https:\/\/ssl-vg03.met.vgwort.de\/na\/41f9fe6bc34d45479b990152efc38249\" width=\"1\" height=\"1\">Some registry entries or files could not be accessed\/changed from users belonging to Administrator group, because the ownership is set to <em>System<\/em> or <em>TrustedInstaller<\/em>. In forums you will find the suggestion, to take ownership and grant full access using the <em>Security <\/em>property page or the commands <em>takeown<\/em> and <em>icacls<\/em>. While this works, it's a sub optimal solution.  <\/p>\n<p>Would it not be better, if you can access objects like registry entries or file and folders with System or TrustedInstaller privileges? Well that's possible, let's have a short look at the situation.  <\/p>\n<h3>Working with System credentials using PsExec.exe<\/h3>\n<p>I came across this solution several years ago. I run the registry editor (regedit.exe) via <em>Run as administrator, <\/em>but I wasn't able to change some registry keys. My problem was, that I've used VMLite and Virtualbox on the same machine, and ended with USB support issues. I was in need to delete a registry key, but that was refused. I've discussed this issue long time ago within my German blog post <a href=\"http:\/\/www.borncity.com\/blog\/2010\/09\/26\/vmlitevirtualbox-und-der-usb-support\/\" target=\"_blank\" rel=\"noopener noreferrer\">VMLite\/VirtualBox und der USB-Support<\/a>.  <\/p>\n<p>Instead of tampering with access rights and take ownership of the key, I came across a smoother solution. The <a href=\"https:\/\/technet.microsoft.com\/de-de\/sysinternals\/pxexec.aspx\" target=\"_blank\" rel=\"noopener noreferrer\">Sysinternals-Suite<\/a> contains the program <em>PsExec.exe<\/em>, that can be run from command prompt. Using the command:&nbsp; <\/p>\n<p><em>PsExec.exe -s -i regedit<\/em>  <\/p>\n<p>enables us to rung registry editor with System privileges (the switch \u2013<em>s <\/em>will force that). The switch \u2013<em>i <\/em>requests an interactive mode for the program). The command has to be executed from an administrative command prompt windows (see <a href=\"https:\/\/web.archive.org\/web\/20210512202711\/https:\/\/borncity.com\/win\/2016\/07\/06\/windows10-open-command-prompt-window-as-administrator\/\">Windows 10: Open command prompt window as administrator<\/a>).  <\/p>\n<h3>But that won't work with Explorer<\/h3>\n<p>What I used as a smooth solution to access registry keys owned by System could also be helpful to access files and folders owned by System. But there is a problem: Files and folders will be accessed via Windows Explorer (explorer.exe). And the solution provided above won't work for <em>explorer.exe<\/em>. An attempt to access an object via explorer will be rejected.  <\/p>\n<p><a href=\"http:\/\/www.borncity.com\/blog\/wp-content\/uploads\/2014\/01\/Ordner031.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"Ordner03\" border=\"0\" alt=\"Ordner03\" src=\"http:\/\/www.borncity.com\/blog\/wp-content\/uploads\/2014\/01\/Ordner03_thumb1.jpg\" width=\"420\" height=\"224\"><\/a>  <\/p>\n<p>I've discussed this issue in 2011 within my German blog post <a href=\"http:\/\/www.borncity.com\/blog\/2011\/04\/29\/explorer-als-administrator-ausfhren\/\" target=\"_blank\" rel=\"noopener noreferrer\">Explorer als Administrator ausf\u00fchren<\/a>. The technical background: Windows Explorer is also used as Windows shell \u2013 and Windows has an internal rule that prevents executing <em>explorer.exe <\/em>with <em>System <\/em>user rights. But there is a simple solution: Use a third party file manager instead of <em>explorer.exe <\/em>and execute it with System privileges.  <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"Ordner06\" border=\"0\" alt=\"Ordner06\" src=\"http:\/\/www.borncity.com\/blog\/wp-content\/uploads\/2014\/01\/Ordner06_thumb.jpg\" width=\"609\" height=\"453\">  <\/p>\n<p>I prefer portable file managers like <a href=\"http:\/\/freecommander.com\/en\/summary\/\" target=\"_blank\" rel=\"noopener noreferrer\">FreeCommander<\/a> or <a href=\"https:\/\/explorerplusplus.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">Explorer++<\/a> for this purpose and use <em>PSExec<\/em> to grant System privileges. <\/p>\n<h3>Execute programs as TrustedInstaller, is that possible?<\/h3>\n<p>Some objects (registry keys and files\/folders) are owned by TrustedInstaller \u2013 that's a security feature to protect Windows app folders and system files from being altered by users and malware. The <em>PSExec<\/em> trick won't allow access such objects and alter files, folders or keys. <\/p>\n<p>I've discussed a solution in October 2016 within my German blog post <a href=\"http:\/\/www.borncity.com\/blog\/2016\/10\/27\/tipp-programme-mit-trustedinstaller-privilegien-ausfhren\/\">Programme als System oder TrustedInstaller ausf\u00fchren<\/a>. There is a free program, called <em>PowerRun<\/em>, from <a href=\"http:\/\/www.sordum.org\/9416\/powerrun-v1-1-run-with-highest-privileges\/\" target=\"_blank\" rel=\"noopener noreferrer\">sodrum.org<\/a>, that could be used for that purpose. Martin Brinkmann has also introduced this tool within <a href=\"http:\/\/www.ghacks.net\/2016\/08\/13\/powerrun-run-programs-as-trustedinstaller\/\" target=\"_blank\" rel=\"noopener noreferrer\">this English article<\/a>.<\/p>\n<p>During writing a book about Windows 10 I decided back in January 2016 to test PowerRun again. But I failed to use PowerRun under Windows 10 \u2013 so I couldn't execute a program as TrustedInstaller. The reason was simple: Windows Defender and Smart Screen filter blocked this tool as malicious. I wasn't able to download and unpack PowerRun under Windows 7 and Windows 10. Although I'm sure, PowerRun isn't malicious, this solution is dead. I tested a few other tools (<a href=\"https:\/\/web.archive.org\/web\/20190106114434\/http:\/\/www.vorck.com:80\/windows\/ntauth.html\">RunAsSystem and RunFromToken<\/a>), but have had other issues. <\/p>\n<h3>Use Process Hacker and a Plugins<\/h3>\n<p>Finally I came across a <a href=\"https:\/\/web.archive.org\/web\/20200617042132\/https:\/\/wj32.org\/processhacker\/forums\/viewtopic.php?t=1932\" target=\"_blank\" rel=\"noopener noreferrer\">Process Hacker<\/a> forum thread from 2015. There are some hints how to execute a program as TrustedInstaller.  <\/p>\n<ul>\n<li>You need <em>Process Hacker <\/em>(see <a href=\"https:\/\/sourceforge.net\/projects\/processhacker\/\" target=\"_blank\" rel=\"noopener noreferrer\">SourceForge.net<\/a>) \u2013 I used the portable version offered <a href=\"http:\/\/portableapps.com\/apps\/utilities\/process-hacker-portable\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a> (just unpack the archive into a local folder).\n<li>Download also the TrustedInstaller plugins, mentioned within <a href=\"https:\/\/web.archive.org\/web\/20210722110446\/https:\/\/wj32.org\/processhacker\/forums\/viewtopic.php?t=2407\" target=\"_blank\" rel=\"noopener noreferrer\">this forum thread<\/a>. Unpack the zip archive and copy the .dll files to the appropriate 32\/64 bit <em>plugin <\/em>sub folders.<\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/web.archive.org\/web\/20170720102147\/https:\/\/t53.imgup.net\/Process-Had9fe.jpg\">  <\/p>\n<p>After preparing ProcessHacker in that way, it's simple to execute a Win32 program using the steps below.  <\/p>\n<p>1. Launch <em>ProcessHacker <\/em>using the <em>Run as administrator <\/em>to grant administrative privileges.  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/web.archive.org\/web\/20170720102250\/https:\/\/w06.imgup.net\/Process-Ha2a3c.jpg\">  <\/p>\n<p>2. Open ProcessHacker menu <em>Hacker <\/em>and select the command <em>Run as trusted installer<\/em>.  <\/p>\n<p>3. Enter the command into the dialog box <em>Run as trusted installer <\/em>\u2013 use <em>Browse <\/em>button to select the&nbsp; .exe file and confirm it via <em>OK<\/em>.  <\/p>\n<p>ProcessHacker launches the TrustedInstaller services and hands over the process, that needed to be run with TrustedInstaller privileges. The process will be executed with Autority [NT-Autorit\u00e4t\\System], as it is shown below in Sysinternals Process Explorer.  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/web.archive.org\/web\/20170720111409\/https:\/\/g87.imgup.net\/Process-Ex6375.jpg\">  <\/p>\n<p>This works with registry editor and with portable file managers like Explorer++. It allows me, to alter system files without obtaining ownership and granting full access rights. So I can change things without leaving traces in ownership and access rights. Maybe it's helpful for others.  <\/p>\n<p><strong>Similar articles<\/strong><br \/><a href=\"https:\/\/borncity.com\/win\/win10-wiki\/\">Win10 Wiki<\/a><br \/><a href=\"https:\/\/web.archive.org\/web\/20210512202711\/https:\/\/borncity.com\/win\/2016\/07\/06\/windows10-open-command-prompt-window-as-administrator\/\">Windows 10: Open command prompt window as administrator<\/a><br \/><a href=\"https:\/\/borncity.com\/win\/2016\/10\/21\/windows-updates-fehlende-deinstallation-erzwingen\/\">Uninstalling 'uninstallable' Windows Updates<\/a><br \/><a href=\"https:\/\/borncity.com\/win\/2017\/01\/16\/tip-tools-setacl-and-delproof2-now-are-free-for-commercial-use\/\">Tip: Tools SetACL and Delproof2 now are free for commercial use<\/a><br \/><a href=\"https:\/\/web.archive.org\/web\/20220507042813\/https:\/\/borncity.com\/win\/2016\/09\/17\/heidoc-net-and-windows-und-office-iso-download-tool-an-update\/\">heidoc.net and 'Windows und Office ISO Download Tool' \u2013 an update<\/a><br \/><a href=\"https:\/\/borncity.com\/win\/2016\/07\/24\/bugs-in-windows-disk-management-tool\/\">Bugs in Windows Disk Management tool<\/a><br \/><a href=\"https:\/\/borncity.com\/win\/2016\/07\/23\/tool-test-minitool-partition-wizard-free\/\">Tool test: MiniTool Partition Wizard Free<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>[German]In some cases it could be helpful to execute programs as System or Trusted Installer to avoid access denied conflicts. This blog post introduces two solutions for Windows 10.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[30,157,679,76],"class_list":["post-2334","post","type-post","status-publish","format-standard","hentry","category-windows","tag-tip","tag-tool","tag-trusted-installer","tag-windows-10"],"_links":{"self":[{"href":"https:\/\/borncity.com\/win\/wp-json\/wp\/v2\/posts\/2334","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/borncity.com\/win\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/borncity.com\/win\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/borncity.com\/win\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/borncity.com\/win\/wp-json\/wp\/v2\/comments?post=2334"}],"version-history":[{"count":0,"href":"https:\/\/borncity.com\/win\/wp-json\/wp\/v2\/posts\/2334\/revisions"}],"wp:attachment":[{"href":"https:\/\/borncity.com\/win\/wp-json\/wp\/v2\/media?parent=2334"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/borncity.com\/win\/wp-json\/wp\/v2\/categories?post=2334"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/borncity.com\/win\/wp-json\/wp\/v2\/tags?post=2334"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}