/build/static/layout/Breadcrumb_cap_w.png
01/23/2018 1752 views
Using k1000 v8
When I try to use the registry script builder, it inputs the key in:
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\

I need it to go to:
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\

When I try and call it through a batch script, it does the same thing. When i run the reg file manually it goes in the right place. I am at a loss here.

Script:
@echo off  
"MS Reg Entry.reg"

Reg file:
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\QualityCompat]
"cadca5fe-87d3-4b96-b7fb-a231484277cc"=dword:00000000

This is for the Spectre/Meltdown MS registry key entry. Any help would be great!

-Rob
0 Comments   [ + ] Show comments

Comments


All Answers

1
You can use the reg.exe command and use the /reg:64 flag.
Answered 01/24/2018 by: chucksteel
Red Belt

  • When i run the script like this:
    @echo off
    reg add “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\QualityCompat” /v cadca5fe-87d3-4b96-b7fb-a231484277cc /t REG_DWORD /d 0 /f /reg:64

    It hangs until i kill the process on the local box. It does the same thing when i run the command manually unless i have an elevated CMD window,
    • How is your script configured? Is it an online shell script or something else?
      • Online Kscript
      • Try using an online shell script. This is what my test script looks like:
        reg add "HKEY_LOCAL_MACHINE\Software" /v Test /t REG_SZ /d 32or64 /f /reg:64

        The script name is addreg.cmd.
    • You could also have the reg file as a dependency and do it with: reg import <name>.reg /reg:64. Having to use elevated command prompt, makes it sound like a UAC issue.

      http://www.itninja.com/question/how-can-i-elevate-a-command-prompt-to-run-a-batch-file-through-scripting
1
I've had good luck using this. The key is to use %windir%\sysnative

I believe something like this will work:

Answered 01/24/2018 by: five.
Second Degree Green Belt

  • this still redirects it to:
    Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\QualityCompat
    • Odd. It works great in my environment. The local users are not admins and I must run all scripts with local admin credentials.
    • I know its kind of late, but hopefully can help others. The program name is not regedit.exe it was regedt.exe

      You can check it by launch cmd from %WINDIR%\SysWOW64\cmd.exe then cd into %WINDIR%\Sysnative

      Notes: Sysnative folder doesnt only available from 32bit process