Solved

Script help for binary reg key change

Posted on 2009-07-07
2
535 Views
Last Modified: 2012-08-13
i need to script a change to reg key:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects2

to overwrite the existing setting with :
"Settings"=hex:28,00,00,00,ff,ff,ff,ff,03,00,00,00,03,00,00,00,6b,00,00,00,22,\
  00,00,00,00,00,00,00,de,03,00,00,00,05,00,00,00,04,00,00

I don't know how to do this... i came up with :  
Option Explicit
On Error Resume Next

'Const HKCU = &H80000001 'HKEY_CURRENT_USER


strComputer = "."
Set StdOut = WScript.StdOut
'load the registry
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
strComputer & "\root\default:StdRegProv")

'strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects2"

But I don't knwo where to go from here or if this will even work...

If anyone can help me, I'd really appreciate it.

Thanks,
KV
0
Comment
Question by:katievegas1127
2 Comments
 
LVL 38

Accepted Solution

by:
Shift-3 earned 500 total points
ID: 24797410
Paste the script below into a text file with a .cmd extension.  Running it will set the registry value.


@echo off

setlocal
 

set key=HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects2

set data=28000000ffffffff03000000030000006b0000002200000000000000de0300000005000000040000
 

reg add "%key%" /v Settings2 /t REG_BINARY /d "%data%" /f

Open in new window

0
 

Author Closing Comment

by:katievegas1127
ID: 31600731
Thank you!
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup". After a while, you have entered a loop for Auto repair which does not fix anything and you will be in a  panic as all your work w…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now