Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Registry access error #176

Open
BolteDev opened this issue May 4, 2024 · 5 comments
Open

Registry access error #176

BolteDev opened this issue May 4, 2024 · 5 comments

Comments

@BolteDev
Copy link

BolteDev commented May 4, 2024

Using latest script and a clean ISO from UUP (22631.3527 - 23H2) getting the below error in the log.

False
MethodInvocationException: D:\Tiny11\tiny11maker.ps1:284
Line |
 284 |  $regKey = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey("zSOFTW …
     |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Exception calling "OpenSubKey" with "3" argument(s): "Requested registry access is not allowed."
MethodInvocationException: D:\Tiny11\tiny11maker.ps1:284
Line |
 284 |  $regKey = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey("zSOFTW …
     |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Exception calling "OpenSubKey" with "3" argument(s): "Requested registry access is not
     | allowed."

tiny11.log

@BolteDev
Copy link
Author

BolteDev commented May 5, 2024

Just to add to this, I swapped out the system drive and all instances of it for D: drive to ensure its not permissions related, same issue.

The other registry commands complete OK.
It just seems to fall over when it reaches

$regKey = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey("zSOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks",[Microsoft.Win32.RegistryKeyPermissionCheck]::ReadWriteSubTree,[System.Security.AccessControl.RegistryRights]::TakeOwnership)

@BolteDev
Copy link
Author

BolteDev commented May 5, 2024

Ok, so I ran this with windows Powershell, instead of Powershell Core, and it was able to complete successfully without the mentioned error.

@ntdevlabs
Copy link
Owner

I actually noticed that there is a difference when running the script from Terminal (as it cannot takeown the registry keys - maybe a sandbox measure?) compared to running it by right-clicking and selecting "run with PowerShell", where it runs just fine

@BolteDev
Copy link
Author

BolteDev commented May 5, 2024

I still ran it in Terminal, just using the Windows Powershell profile

@ebuwiz
Copy link

ebuwiz commented May 30, 2024

I actually noticed that there is a difference when running the script from Terminal (as it cannot takeown the registry keys - maybe a sandbox measure?) compared to running it by right-clicking and selecting "run with PowerShell", where it runs just fine

#198 Related... If you run the script via cmd "Home" edition will not finish correctly, but with "run with powershell" it not have any problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants