Page 1 of 1 1
Topic Options
#47919 - 1999-07-02 06:15 AM To automate registry modification.
Anonymous
Unregistered


I developed a KiXtart script to change all the Registry entries of a machine.
The script I believe works but I need to start manually REGEDIT to export (in text mode) the four main Registry subtrees HKEY_CLASSES_ROOT, HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE, HKEY_USERS. I change all the entries I need and after I import the modified file using %COMSPEC% /C registry /S "myFileReg.txt".

I have got hundreds of machines to change and I can't automate the work because I'm not idea how to save the registry subtrees.

Please, help me.
Thanks

P.S. We need to save every subtree because the REGISTRY application doesn’t save the entire registry.

Top
#47920 - 1999-07-03 07:08 PM Re: To automate registry modification.
Anonymous
Unregistered


I had to alter the HOST name on all machines to = the asset sticker on the PC. I was going to have to use PoleEdit to remove the system policy so I could get to control panel/ networking until...

; sus out the host name
$hostname = ReadValue( "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Tcpip\Parameters" , "Hostname" )

$Selection = MessageBox( "Does the above hostname match the [barcoded] Asset Sticker on your PC?"," the hostname of this workstation is: $hostname", 36 )

If $Selection <> 6 goto no endif

goto done

:no

? "Lets fix it...."

color g+/n
? "Please enter the asset number for this PC: "
color w+/n
? gets $hostname

if $hostname = ""
goto no
else
writevalue( "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Tcpip\Parameters" , "Hostname" ,
"$hostname" , "REG_SZ" )

:done
? "fixed, the HOST name is now: " $hostname


TO find the registry key I enterd "bart" as a host name, searched for "bart" and exported the key...

I later extened this script to write to the INI file, it also required the host name...

WRITEPROFILESTRING ("c:\sbs\config\conlive\confirm.ini" ,"client" ,"station" ,"$hostname")

contact johnhb@paradise.net.nz

Top
#47921 - 1999-07-05 05:54 AM Re: To automate registry modification.
Anonymous
Unregistered


Sorry,
the correct sentence is:
SHELL '%COMSPEC% /C REGEDIT /S "myFileReg.txt"'

John,
I read carefully your reply and the example you show works but the real trouble is I don't now how to save the main subtrees (HKEY_...).

Thanks a lot.

Top
#47922 - 1999-07-09 02:31 AM Re: To automate registry modification.
Anonymous
Unregistered


to save a tree open RegEdit...
find the bit you want..
click on Registry on the menu bar...
then...
Export Registry File... it will be given the extention .reg
ps for machine settings yourle probably find it in "Local Machine"...
email johnhb@paradise.net.nz if your stuck

------------------
------------------------
John Hornblow
Wellington New Zealand
johnhb@paradise.net.nz
------------------------

Top
#47923 - 1999-07-09 04:29 AM Re: To automate registry modification.
Anonymous
Unregistered


Many thanks, John but my trouble is I don't know how to save automatically the registry.
I tested the SAVEKEY keyword without success. I'm searching in the Resource Kit too.

Another idea?.

Top
#47924 - 1999-07-09 08:32 AM Re: To automate registry modification.
Anonymous
Unregistered


I've got almost the same problem when I was trying to save the Outlook-profile string with the option "Savekey". Although I had full permissions on the registry, the .reg-file stays empty. After I added the Domain Users to the "Backup and Restore" user rights, it worked perfectly.
(Ofcourse, this was with Windows NT Workstation and not with Windows 9x.)

Richard Voorter
r.voorter@stepco.nl


Top
#47925 - 1999-07-12 02:01 PM Re: To automate registry modification.
Anonymous
Unregistered


Try using ScripIT. I have found this to be a helpful utility when command line is not possible.
Top
#47926 - 1999-07-13 03:02 AM Re: To automate registry modification.
Anonymous
Unregistered


I HAVE GOT THE SAME TROUBLE.
When I execute:
$SaveCode=SAVEKEY("HKEY_CLASSES_ROOT", "HKCR.reg")
IF 0=$SaveCode
?"Key HKEY_CLASSES_ROOT (HKCR.reg) OK."
; W95 need to change RHS
IF 2=$SO SHELL "$Cmd ATTRIB -r -h -s HKCR.reg" ENDIF
ELSE ?"ERROR HKCR: $SaveCode"
ENDIF

I always get a binary file (different to the REG text file we get with the REGEDIT utility).

SOME IDEA HOW TO SAVE THE REGISTRY?.
Where I'm wrong, please?

Top
#47927 - 1999-07-13 08:18 AM Re: To automate registry modification.
Anonymous
Unregistered


You MUST use LOADKEY when restoring the registry entry you get from SAVEKEY. It must stay in the KIX enviroment.

Likewise, a reg file created outside of KIX will not work with LOADKEY.

I hope this is clear

------------------
Anthony J. Reno
renoa@rfa.org


Top
#47928 - 1999-07-13 08:38 AM Re: To automate registry modification.
Anonymous
Unregistered


In Windows 95, under Real Mode, you can use the /e switch with regedit. Look at the Q131352.
For instance "regedit /l:c:\windows\system.dat /e c:\system.txt" would export all the registry to a text file.

------------------
Luis Hevia

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2312 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.054 seconds in which 0.023 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org