Page 1 of 1 1
Topic Options
#38419 - 2003-03-26 01:55 PM Reg adjustment on several work-stations
AzzerShaw Offline
Seasoned Scripter
****

Registered: 2003-02-20
Posts: 510
Loc: Cheltenham, England
Hi guys and galls

Im need to make a slight change in the regisrty on a few pcs in the key - HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Excel.Chart.5 and then edit a flag. I need to do this on several machines which i have in a .txt, can anyone shed any light on how I go about this ? Ive tried several diffrent things but think im going up the wrong tree !!!
_________________________
If at first you don't succeed, try again. Then quit. There's no use being a damn fool about it. - W.C Fields

Top
#38420 - 2003-03-26 01:59 PM Re: Reg adjustment on several work-stations
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
now, you would need to provide some more info for us to really help you.

if the file is txt and not ini...

the whole procedure would need these functions:
open()
readline()
close()
writevalue()

but without more info, can't do much.
_________________________
!

download KiXnet

Top
#38421 - 2003-03-26 02:25 PM Re: Reg adjustment on several work-stations
AzzerShaw Offline
Seasoned Scripter
****

Registered: 2003-02-20
Posts: 510
Loc: Cheltenham, England
Basically i want the kix file to read a file (whether it be a ini or a text) to use the computer names listed in it and then change the below flag from 00 00 01 00 to 00 00 00 00 the location of this in the regisrty is - HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Excel.Chart.5. And I only need to do this once.
_________________________
If at first you don't succeed, try again. Then quit. There's no use being a damn fool about it. - W.C Fields

Top
#38422 - 2003-03-26 02:45 PM Re: Reg adjustment on several work-stations
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
next I have to ask, what you have tried?

have you already got an picture how it will go?
do you have anything written yet?

what version of kix you use?
did you check manual for the functions I pointed?
_________________________
!

download KiXnet

Top
#38423 - 2003-03-26 02:49 PM Re: Reg adjustment on several work-stations
Kdyer Offline
KiX Supporter
*****

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

Have a look at this > Last Response..

It does this remotely (from your desktop, for example)..

Machine registrations in AD

This does pretty much what you are looking for.

The other thing is that the change you are trying to do probably does not need a restart.

HTH,

Kent

[ 26. March 2003, 14:51: Message edited by: kdyer ]
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#38424 - 2003-03-26 03:54 PM Re: Reg adjustment on several work-stations
AzzerShaw Offline
Seasoned Scripter
****

Registered: 2003-02-20
Posts: 510
Loc: Cheltenham, England
Thanks, that looks really complicated for what im trying to achchieve. To give you bit of background information all the Pc's are NT4 and we are using kix 3.47.0.0. I just need for the script to look at a list of Pc names(this is where im getting stuck)and then make an adjustment in the registry (as above) Ive doing trying to do this so I dont have to manually change 200 Pc's one by one [Embarrassed] (
_________________________
If at first you don't succeed, try again. Then quit. There's no use being a damn fool about it. - W.C Fields

Top
#38425 - 2003-03-26 03:57 PM Re: Reg adjustment on several work-stations
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
I get back to my old question, what you have tried before that ain't working?
_________________________
!

download KiXnet

Top
#38426 - 2003-03-26 09:12 PM Re: Reg adjustment on several work-stations
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Read the textfile as instructed above. For each of the computernames do a WRITEVALUE('\\COMPUTER\HKEY_LOCAL_MACHINE\...',...)
and so on. This requires local administrative privileges on all computers.
_________________________
There are two types of vessels, submarines and targets.

Top
#38427 - 2003-03-26 09:47 PM Re: Reg adjustment on several work-stations
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
I'm on a good mood once again.
here is the complete script. run it as admin and you are done:

code:
$nul=open(1,"mylist.txt")
$name=readline(1)
while @error=0
$nul= writevalue("HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Excel.Chart.5","flagYOUdidn'tTELLwhatITis",0,"REG_DWORD")
$name=readline(1)
loop
$nul=close(1)

BUT AS I SAID BEFORE...
you are not giving all the info.
even though I gave you the whole code on silver plate, it may not work unless you know the VALUENAME!!!!!!!!

please, help yourself if you don't let us do that!
_________________________
!

download KiXnet

Top
#38428 - 2003-03-27 09:47 AM Re: Reg adjustment on several work-stations
AzzerShaw Offline
Seasoned Scripter
****

Registered: 2003-02-20
Posts: 510
Loc: Cheltenham, England
Many thanks for your patience, below is what i have done and although it is working ive tested it on a Pc and it hasnt worked. Is there a way I can write to a text file with results ? Or have you guys got an idea whats going wrong ? It was coming up with some error parameters but after i altered it, it seems to run through fine below is what i am using :

$nul=open(1,"coolice69.txt")
$name=readline(1)
while @error=0
$nul=writevalue("HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Excel.Chart.5","editflags","00 00 01 00","REG_SZ")
$name=readline(1)
loop
$nul=close(1)

If any one has any suggestions i would be most grateful, thanks

AzzerShaw
_________________________
If at first you don't succeed, try again. Then quit. There's no use being a damn fool about it. - W.C Fields

Top
#38429 - 2003-03-27 03:25 PM Re: Reg adjustment on several work-stations
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Well, don't know why you get all those $name from a text file cuz you never use them. All your reg mods are done to the local machine. Don't you want to modify the remote machines?

Should it not be:
$nul=writevalue("\\"+$name+"\HKLM\SOFTWARE\Classes\Excel.Chart.5","editflags","00 00 01 00","REG_SZ")

Also, the code is overly optimistic. I don't think it was meant as a complete solution on a silver platter, but rather as a proof of concept. You should check if the machine is turned on, if the reg write was successful, etc.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#38430 - 2003-03-27 03:30 PM Re: Reg adjustment on several work-stations
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
You might also want to mention the KiXtart version you are using. Remote rtegistry writes are explained in the KiXtart Manual and in both Les' and my post. You can sue @ERROR/@SERROR to determine whether a registry write was successful or not. This is also explained in the KiXtart Manual.
_________________________
There are two types of vessels, submarines and targets.

Top
Page 1 of 1 1


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

Who's Online
0 registered and 1363 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.141 seconds in which 0.077 seconds were spent on a total of 11 queries. Zlib compression enabled.

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