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

Issue when doing Binary with Set-RegistryValueForAllUsers #1

Open
MazeGoh opened this issue Aug 10, 2020 · 1 comment
Open

Issue when doing Binary with Set-RegistryValueForAllUsers #1

MazeGoh opened this issue Aug 10, 2020 · 1 comment

Comments

@MazeGoh
Copy link

MazeGoh commented Aug 10, 2020

First of all, thanks for the super nice script you had created.
For my cases I try to assign a binary key value of "080000000000000001000000020000000300000004000000050000000600000007000000"
In the end, the it give me an error
Set-ItemProperty : Cannot convert value "080000000000000001000000020000000300000004000000050000000600000007000000" to type "System.Byte[]". Error: "Cannot convert value
"080000000000000001000000020000000300000004000000050000000600000007000000" to type "System.Byte". Error: "Value was either too large or too small for an unsigned byte.""
At line:34 char:17

  • ... Set-ItemProperty -Path "HKU:$sid$($instance.Path)" -Nam ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : WriteError: (HKEY_USERS\S-1-...\Addin Menu IDs:String) [Set-ItemProperty], PSInvalidCastException
    • FullyQualifiedErrorId : System.Management.Automation.PSInvalidCastException,Microsoft.PowerShell.Commands.SetItemPropertyCommand
@MazeGoh
Copy link
Author

MazeGoh commented Aug 10, 2020

I'm not sure if I had this issue resolve or not

I check some post and stated need to manually hexified the binary
$regKeyValue = "08,00,00,00,00,00,00,00,01,00,00,00,02,00,00,00,03,00,00,00,04,00,00,00,05,00,00,00,06,00,00,00,07,00,00,00"
$hexified = $regKeyValue.Split(',') | ForEach-Object { "0x$_"}

After I done it, the error doesn't come out anymore but in the stubpath the registry key was showing System.Byte[] instead of the actual value.
I wonder where registry editor actually store those value at

@MazeGoh MazeGoh closed this as completed Aug 10, 2020
@MazeGoh MazeGoh reopened this Sep 18, 2020
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

1 participant