Page 1 of 1 1
Topic Options
#66694 - 2002-06-11 05:01 PM Incorporating a Reg file
jwawrzynski@pbwt.com Offline
Fresh Scripter

Registered: 2002-06-06
Posts: 15
Without using the shell command what would be the best way to incorporate a registry file.

shell 'regedit /s //server/share/....' DOES work but would like to keep the number of recursive calls that kix makes to a minimum.

TIA

Top
#66695 - 2002-06-11 05:09 PM Re: Incorporating a Reg file
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Firstly, you might want to try this version of the shell command, it waits for regedit.exe to finish:

shell '%COMSPEC% /c regedit /s \\server\share....'

ah, then you have to consider possible security issues, might want to check the errorlevel with:

?"@ERROR : @SERROR"

after your shell.

Then, there are known issues when writting to HKCU under Win95, what platform are you writing to ?

Lastly, you might want to check out the builtin Kixtart functions READVALUE() and WRITEVALUE(), that read and write to the registry directly, without having to shell-out to regedit. Might be a better way to go if you only have a poke or two.

-Shawn

Top
#66696 - 2002-06-11 05:31 PM Re: Incorporating a Reg file
jwawrzynski@pbwt.com Offline
Fresh Scripter

Registered: 2002-06-06
Posts: 15
Sorry
platform is NT4

I will look into the READVALUE() and WRITEVALUE() functions.

Thanks

Top
#66697 - 2002-06-11 05:58 PM Re: Incorporating a Reg file
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
I prefer read/writevalue, than reg files. But it always depended on how BIG the reg file was.
(i'm too lazy to write a bunch of code for that)
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#66698 - 2002-06-11 06:51 PM Re: Incorporating a Reg file
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
BTW,

This is also in the FAQ Forum and under - LOADKEY - Why doesn't it work?.

HTH,

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#66699 - 2002-06-12 03:34 AM Re: Incorporating a Reg file
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11625
Loc: CA
In reply to your comment:

"Without using the shell command what would be the best way to incorporate a registry file"

I don't think you can do it without a SHELL command. You can READ/WRITE/DELETE entries using internal commands of KiXtart, but not "incorporate" a registry file. So unless you are willing to use SHELL, you will have to use the commands of KiXtart to perform registry tasks.

Top
#66700 - 2002-06-12 04:52 AM Re: Incorporating a Reg file
BrianTX Offline
Korg Regular

Registered: 2002-04-01
Posts: 895
Hmm.. yeah.. a registry file... I'm not sure that there isn't a way to load it using WMI.... just a hunch.

Brian

Top
#66701 - 2002-06-12 05:41 AM Re: Incorporating a Reg file
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11625
Loc: CA
I would doubt it. WMI can do a lot, but I don't recall seeing any documentation or sample code of opening external data files and manipulating it. If you know of some that would be cool, please share the code or a link.

Thanks...

Top
#66702 - 2002-06-12 02:49 PM Re: Incorporating a Reg file
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
I am using a .INI file to incorporate registry changes. The routine first enumerates the sectiosn and then read the keys for each section. If the referenced registry key ahs changed, then it'll be updated.
.INI structure:
code:
; Mandatory registry settings for users
;
; Format:
;
;[RegistryEntryNumber]
;Kernel = OS kernel verion to which the registry setting should be applied
;GroupInclude = User groups to be included in the registry update
;HKey = Registry key (HKCU, HKLM, HKCR)
;Subkey = Registry subkey
;Entry = Registry entry
;Value = Registry value
;Type = Registry type (defaults to REG_SZ)
;Reboot = Reboot flag (defaults to 0)

[1]
Kernel=WinNT, Win2K
GroupInclude=Domain Users
HKey=HKCU
Subkey=SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
Entry=AutoRestartShell
Value=1
Type=REG_DWORD
Reboot=0

Code for the routine is posted in the UDF section: ProcessRegINI()
_________________________
There are two types of vessels, submarines and targets.

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 2366 anonymous users online.
Newest Members
BeeEm, min_seow, Audio, Hoschi, Comet
17882 Registered Users

Generated in 0.052 seconds in which 0.027 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