MSFN Forum: copying values between reg keys - how? - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

copying values between reg keys - how? Rate Topic: -----

#1 User is offline   phenob 

  • Group: Members
  • Posts: 2
  • Joined: 21-July 05

Posted 21 July 2005 - 09:42 PM

Hi all - long time ghost, first time post -

I'm trying to find a simple way to copy the string data from one registry value to another in a different key. Been at this for hours.. gotta be missing something. It can't be this difficult..

basically I'm trying to set the value of the ms office registered owner to be the same as the windows registered owner. I do not have control over the office installation which defaults to our company name.

I've tried using reg query but it's too verbose, I need something that will return just the string in the value, nothing else. Or even better something that would just copy the data from one arbitrary registry value to another.

Hopefully this makes some sense. Any advice? Thanks in advance.

phnb

edit* This is something I intend to stick into a batch for runoncex.

This post has been edited by phenob: 21 July 2005 - 09:44 PM



#2 User is offline   phenob 

  • Group: Members
  • Posts: 2
  • Joined: 21-July 05

Posted 21 July 2005 - 10:46 PM

Here's what I've come up with to solve this. I'd love to see a simpler way if it exists.

First reg query the windows registered organization value and dump it to a text file
reg query "hklm\software\microsoft\windows nt\currentversion" /v registeredorganization > regorg.txt


Then for loop through the verbosity in the text file and pull out our value data into an environment variable
for /f "skip=2 tokens=2*" %%a in (regorg.txt) do set regorg=%%b


Finally set the ms office registered company value with our variable
reg add "hklm\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\9040110900063D11C8EF10054038389C\InstallProperties" /v RegCompany /t REG_SZ /d "%regorg%" /f


If nothing else, hopefully this helps someone else out.

phnb

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy