Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Get "Invalid root in registry key" when call RegWrite function on Wow6432Node

$
0
0

My environment is Windows 2008 R2. I have the local administrator permission and the UAC is turned off.

There is a 32bit application installed on the server and I need to update its registry key value "AuditTime" under this node

HKLM\Software\Wow6432Node\Myapplication

I simply run this just two line vbscript

Set Wshell = CreateObject("Wscript.Shell")

Wshell.RegWrite "HKLM\Software\Wow6432Node\Myapplication\AuditTime",Now(),"REG_SZ"

But I got error as following:

Invalid root in registry key "HKLM\Software\Wow6432Node\Myapplication\AuditTime"

Then I updated the script to perform a little test. The script is like this

Set Wshell = CreateObject("Wscript.Shell")

Wshell.RegWrite "HKLM\Software\Myapplication2\AuditTime",Now(),"REG_SZ"

Wshell.RegWrite "HKLM\Software\Wow6432Node\Myapplication\AuditTime",Now(),"REG_SZ"

The first RegWrite is successfully run and I got the value written as expected however the second RegWrite failed again with the same error.

So it is clear nothing to do with permission since I have full access. I can create the values under both hive in Regedit.exe.

A little further testing shows the Invalid root error just showing when I tried to update valued under HKLM\Software\Wow6432Node hive.

Any suggestion?


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>