tabs-not-spaces / CodeDump

things that help me. might help others.
GNU General Public License v3.0
105 stars 39 forks source link

Issue when doing Binary with Set-RegistryValueForAllUsers #1

Open MazeGoh opened 4 years ago

MazeGoh commented 4 years ago

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

MazeGoh commented 4 years ago

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