Run (File Manager) as TrustedInstaller

Discussion in 'Scripting' started by freddie-o, Oct 25, 2021.

  1. freddie-o

    freddie-o MDL Addicted

    Jul 29, 2009
    933
    1,209
    30
    #1 freddie-o, Oct 25, 2021
    Last edited: Jan 11, 2022 at 02:24
    This is useful when we need to copy, delete, rename, move, change or modify System or Read-only files and folders

    Warning:

    • Copying, deleting, renaming, moving, changing or modifying System or Read-only files and folders can cause your operating system to not operate correctly -- or worse -- stop functioning altogether!
    • Use only if you know what you are doing!

    This toggle batch script kills explorer.exe and runs Total Commander as TrustedInstaller (using PowerRun to elevate)
    • Terminating explorer.exe lessens restrictions and gives more access to files and folders
    • I use Total Commander for my File Manager. Just replace "TOTALCMD64.EXE" in the script with your preferred File Manager

    Explorer.exe will automatically restart as soon as you exit your File Manager


    Download
    PowerRun (Credits to @wtarkan)
    Total Commander




    Script
    Code:
    @echo off
    SETLOCAL EnableExtensions
    set EXE=TOTALCMD64.EXE
    taskkill /f /im explorer*
    "%~dp0PowerRun_x64.exe" /SW:0 "%EXE%"
    :LOOP
    timeout /t 3 /nobreak
    FOR /F %%x IN ('tasklist /FI "IMAGENAME eq %EXE%"') DO IF %%x == %EXE% goto LOOP
    start "" explorer.exe
    endlocal &exit
    

     
  2. Dark Monkey

    Dark Monkey MDL Addicted

    Feb 2, 2011
    677
    830
    30
    #2 Dark Monkey, Oct 25, 2021
    Last edited: Oct 25, 2021
    Count !2! Problems
    1) explorer sometimes restart itself after killing it :p
    2) start explorer In windows 11 under TrustedInstaller privileges, sometimes fails
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. freddie-o

    freddie-o MDL Addicted

    Jul 29, 2009
    933
    1,209
    30
    #4 freddie-o, Oct 25, 2021
    Last edited: Nov 1, 2021
    (OP)
    Here's another script that adds a Registry key to keep Explorer from restarting

    Explorer doesn't restart properly on a regular user account in Windows 11 when modifying the registry
     
  4. acer-5100

    acer-5100 MDL Addicted

    Dec 8, 2018
    662
    433
    30
    Just use xyexplorer free and launch it using nsudo (or similar tool) via a shortcut like


    C:\XY\NSudoLG64.exe -U:T -P:E ".\xy.exe"

    No need to kill explorer or other complications
     
  5. freddie-o

    freddie-o MDL Addicted

    Jul 29, 2009
    933
    1,209
    30
    If you're not going to kill Explorer why not just use Run Explorer as TI
    No need for a 3rd party File manager
    After using all the TrustedInstaller apps I can get my hands on, PowerRun is still the most reliable and dependable
    XYplorer is a trialware
    Whatever works for you
     
  6. acer-5100

    acer-5100 MDL Addicted

    Dec 8, 2018
    662
    433
    30
    nsudo is simple portable and works, then there are a number of alternatives, but given nsudo never failed since i use it I never felt the need to use a reinvented wheel


    First: YX is a really great FM with an huge amount of handy features that explorer can only dream of (folder size calculation just to pick one from a long list)

    Second: given explorer is not just a FM but also the main shell, running it as TI can lead to a number of unexpected behaviors which I prefer to avoid.


    I specified XY explorer free for a reason. Just google for it.

    Whatever you can use whatever FM you like, Explorer++ for example, which is tiny and well maintained.
     
  7. Dark Monkey

    Dark Monkey MDL Addicted

    Feb 2, 2011
    677
    830
    30
    I can't recommend old version from 2016 :D
    Code:
    Below you can still download the last version of XYplorerFree, ver 17.40.0100, released 26-Nov-2016.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. acer-5100

    acer-5100 MDL Addicted

    Dec 8, 2018
    662
    433
    30
    Yeah any sw which isn't released yesterday will surely melt your PC :D

    [​IMG]