Jump to content

Applying REG file on 64 bits Win7 with command line.


Rhor

Recommended Posts

Greetings.

I have this bunch of REG files that I used to apply on Windows 7 32 bits through command line (regedit.exe /s "file.reg").

Now I had to switch to a 64 bits version of Windows 7, and when I want to apply those REG files, the registry keys do not change.

Is there any special considerations I need to know to apply those REG files on 64 bits Win7 version through command line arguments?

Thank you in advance.

Link to comment
Share on other sites


Which keys are you checking?

The native 64-bit Registry Editor should be updating the keys directly, the 32-bit WOW64 one would update the keys read by 32-bit apps, under Wow6432Node...

You could try the 32-bit Registry Editor in C:\Windows\SysWOW64 if the values are to be used by 32-bit processes...

Link to comment
Share on other sites

I'm modifying the usual "HKEY_CURRENT_USER\Software\AnyRandomAPP" keys that stores software configurations.

I have scripts written on a program called "Vtask" that install all my programs silently, and part of those scripts export configuration keys to the registry itself, the script call a .reg file to apply it.

When I double click the .reg file directly, it works of course, but when the Vtask script tries to do it, it doesnt work. So I pressume is some kind of problem with Vtask itself, but I tried many things with no success, that's why I asked if I was ignoring something new with a x64 registry.

I will try to use REGEDIT on "C:\Windows\SysWOW64 " in different ways to see if it works.

Thank you for your comment.

Link to comment
Share on other sites

When I double click the .reg file directly, it works of course, but when the Vtask script tries to do it, it doesnt work.
Aha, then it's the other way around :)

Double-clicking a .reg file will run the native (x64) Registry Editor and the setting is imported exactly as it appears.

If this Vtask thing is a 32-bit process, then when it calls registry APIs to import the file, it will get redirected to HKEY_CURRENT_USER\SoftwareWow6432Node\AnyRandomAPP.

This is expected behaviour for 32-bit apps running on 64-bit Windows, to allow for backwards compatibility but keeping them distinct (because the assumption is that if a 32-bit process writes the registry value, it is to be read by another 32-bit process).

Using Registry Editor in the SysWOW64 folder will just do the same as Vtask.

Link to comment
Share on other sites

vTask is compatible with 32 or 64 bit environments (or so they say), so the script should call the 64 bit version of Regedit when needed.

Anyway, after many hours of trying different combinations, I was able to deduce that the only key that cannot be modified when it is being called from vTask (or AutoIt, or Autohotkey for that matter) is "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run".

The "Wow6432Node" variants of that same key can be modified with no problem.

Finally, I remembered that Registry Workshop had command line support, so I replaced "Regedit.exe" for "RegWorkshopX64.exe" (wich installs on Program Files, not Program Files x86) on my script and it worked perfectly, I was finally able to modify "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" again.

I hope someone else find this info useful in some way.

AutoIt or Autohotkey suffer the same limitation of vTask in this case.

Thank you.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...