I use this in my AutoIt script and it works fine : Code: RegWrite('HKCR\batfile\shell\' & $MenuLabel1 & '\shell\35'& $MenuLabel1, '', 'REG_SZ', $MenuText) RegWrite('HKCR\batfile\shell\' & $MenuLabel1 & '\shell\35'& $MenuLabel1, 'MUIVerb', 'REG_SZ', $MenuText) RegWrite('HKCR\batfile\shell\' & $MenuLabel1 & '\shell\35'& $MenuLabel1, 'Icon', 'REG_SZ', '"' & $sInstExePath & '", 0') RegWrite('HKCR\batfile\shell\' & $MenuLabel1 & '\shell\35'& $MenuLabel1 & '\command', '', 'REG_SZ', '"' & $sInstExePath & '" "/WD:%W" "%L"') I previously had /WD:"folderpath" and that worked OK too. Since the developer has specified to include the /WD: within quotes that's what I do now. This is a bat file generated by PowerRun : Code: @Echo Off Start "" "D:\PowerRun Portable\PowerRun_x64.exe" "/WD:%SystemDrive%\Portable Programs\Notepad2\" "%SystemDrive%\Portable Programs\Notepad2\Notepad2.exe" pause
Code: reg add "HKCR\*\shell\Run as TrustedInstaller" /v "Icon" /t REG_SZ /d "imageres.dll,208" /f >NUL If anyone is running W11 Enterprise (iot) LTSC 24H2 and uses this bat script from the OP, you'll need to change the icon ID from 101 to 208 for the correct icon to show. Otherwise, you may see a green check mark instead. Not a big deal other than cosmetics.
"imageres.dll,101" shows a green shield with a checkmark icon for both Windows 10 and 11 "imageres.dll,208" in Windows 11 is "imageres.dll,1" in Windows 10 But it's up to you guys what icon you prefer to use
Thanks , and on your post #1 https://forums.mydigitallife.net/threads/run-as-trustedinstaller-from-context-menu.80713/ we can see on the spoiler in your context menu "Fast delete" , "Unlock and delete" and "kill explorer unlock and delete" Can you post another thread for this or explanations. There is interesting, thanks I found for fast delete a very good multithreaded folder removal app Spoiler: byenow - https://iobureau.com/byenow/ - https://github.com/apankrat/byenow But i I can't launch it from the context menu because I think i am missing the path of the file when I right click on it, but how to integrate it.
I rarely use these functions so I don't think it merits a new Thread They also don't work 100% of the time Fast Delete bypasses the Recycle bin so you cannot restore deleted files anymore so you have to use it with caution I use 3rd party apps and their corresponding command lines for these FastCopy has a very powerful delete function LockHunter for unlocking files PowerRun for TrustedInstaller privileges I'm not familiar with this App I use the Registry to add processes to the Context menu
There's a new version of PowerRun. v1.7 File -> Allow command line. This might impact your script. Maybe.
Thanks it does. I use the Reg file to add "Run as TrustedInstaller" to the Context Menu. I can manually "Allow Command Line" so it doesn't affect me I don't know how to automate this using the Batch script @inTerActionVRI do you? Or do we now have to manually download PowerRun, "Allow Command Line" then run the Bat script?
What is the System version of your machine? Go to search, type winver and open it to obtain this data. Ex: 22631.xxxx x64 This is something new. I have this done for the restriction via PowerShell scripts. I need to have time to see this. I will see. Maybe when I see someone I might have discovered something.
Nothing to do with Windows version. PowerRun has been updated and has a new feature/option. PowerRun v1.7 cannot be run from command line unless you first run the GUI and click File -> Allow command line.. A entry is made in the INI file (SecurityCode=xxxxxxxxxx).
yesterday i faced this too. when right clikc to runs as trust installer i get i already downloaded powerrun v 1.7 clicked allow coomand line now it has a checkmark and its greyed out. but i still cant run script. still shows you must select allow commnad line any other way to runs as trust installer.? i clean installed and need to run some scripts but this was the only way i knew on how to run as trsust installer if theres is a way with video would be cool. or a way to continue this way on this thread. thank you
Have you tried running pwsh/cmd from powerrun itself, cd to your script location and run it by using .\ as in .\script.cmd ? happens here also
in my case, there's was a powerrun.ini file in System32 also, so I replaced it with the one from og powerrun folder and now it works properly
Just a suggestion : - use a bat file instead of reg file. - instruct user to copy the bat file to the same directory as PRun. - bat file will now have the address of PRun exe. - user will not have to edit a reg file (what with the double backslashes and all ;-) - add a context menu entry only for batfile cmdfile cplfile ? exefile mscfile ? - try superUser instead of PRun, many of us prefer it to PRun. https://github.com/mspaintmsi/superUser EDIT : the bat file can check if PRun exists in the same folder. and (maybe) check if the INI file has at least one value for Securitycode.
You can also use this, which does not require a third-party tool. https://github.com/AveYo/LeanAndMean/blob/main/RunAsTI.reg
The only way I found to make this work properly was to put a message before launching the PowerRun window, asking the user to grant permission. And after that, start copying the files with the ini already changed, with the permission of your machine, in the system32 folder. In this way works well. If the code is the same at this point, for any machine, I believe this is temporary. My code starts with E9xxxxxxxx