Page 1 of 1 1
Topic Options
#72780 - 2003-01-31 06:16 PM Writing WriteValue in HKLM Issues
Jbutler Offline
Fresh Scripter

Registered: 2003-01-10
Posts: 11
When executing this Kix script Within NT/2000 I am successful. Even when logged on I can execute this Kix script and it will run on 95/98 client. But, when I execute this script from Logon Script, the changes do not take only in 95,98 clients only.
Any ideas on this Windows 95,98 on why it will not execute this script at logon:

Kix Script:

IF @INWIN=1

$LegalKey_Caption ="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System"
$LegalKey_Text = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System"
$Status = WriteValue("$LegalKey_Caption", "LegalNoticeCaption", "Authorized User only", "REG_SZ")
$Status = WriteValue("$LegalKey_Text", "LegalNoticeText", "This computer is only for authroized use only, This is a test.", "REG_SZ")

ELSE

$LegalKey_Caption ="HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\WINLOGON"
$LegalKey_Text ="HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\WINLOGON"
$Status = WriteValue("$LegalKey_Caption", "LegalNoticeCaption", "Authorized User only", "REG_SZ")
$Status = WriteValue("$LegalKey_Text", "LegalNoticeText", "This computer is only for authroized use only, This is a test.", "REG_SZ")

ENDIF
RETURN
EXIT

Top
#72781 - 2003-01-31 06:42 PM Re: Writing WriteValue in HKLM Issues
Jack Lothian Offline
MM club member
*****

Registered: 1999-10-22
Posts: 1169
Loc: Ottawa,Ontario, Canada
Checkout these site:

http://ozzyfrank.150m.com/pages/pc/Windows/Registry/legal_notice.htm
http://support.microsoft.com/?kbid=101063

Based upon these articles I am not sure that either of the above options work?

[ 31. January 2003, 18:46: Message edited by: Jack Lothian ]
_________________________
Jack

Top
#72782 - 2003-01-31 06:57 PM Re: Writing WriteValue in HKLM Issues
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
checking this also might help:
http://luna.scriptlogic.com/support/kb/displayarticle.asp?UID=66&Str=
_________________________
!

download KiXnet

Top
#72783 - 2003-01-31 07:03 PM Re: Writing WriteValue in HKLM Issues
Jack Lothian Offline
MM club member
*****

Registered: 1999-10-22
Posts: 1169
Loc: Ottawa,Ontario, Canada
Jooel,

Maybe you posted this in the wrong thread?
_________________________
Jack

Top
#72784 - 2003-01-31 07:03 PM Re: Writing WriteValue in HKLM Issues
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
to more explain, I can't anyhow remember that which was the booting stuff of win9x, but anyway.

seems that the registry is not loaded before you call it.
as workaround, you can push a special win9x script to runonce key to do the job.

hope this helps!
_________________________
!

download KiXnet

Top
#72785 - 2003-01-31 07:07 PM Re: Writing WriteValue in HKLM Issues
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
hi jack.
no, it was not best link but M$ has hidden pretty well their win9x documents.
anyway as he said:
"Even when logged on I can execute this Kix script and it will run on 95/98 client."

this just translates to a problem during logon and I see it as logon sequence problem... without confirmation though.
_________________________
!

download KiXnet

Top
#72786 - 2003-01-31 07:07 PM Re: Writing WriteValue in HKLM Issues
Jack Lothian Offline
MM club member
*****

Registered: 1999-10-22
Posts: 1169
Loc: Ottawa,Ontario, Canada
Ah!

I thought this was a followup to your note to Les in the general forum.

I don't think this is related to a statup order problem. I beleve it is only the HKCU hive which is undefined in Win9x during logon.

Based upon the above articles he seems to be writing to the wrong key locations in both cases. Why this incorrect code works sometimes is a mystery.

[ 31. January 2003, 19:11: Message edited by: Jack Lothian ]
_________________________
Jack

Top
#72787 - 2003-01-31 07:08 PM Re: Writing WriteValue in HKLM Issues
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
See also Sequence of events during logon
_________________________
There are two types of vessels, submarines and targets.

Top
#72788 - 2003-01-31 07:12 PM Re: Writing WriteValue in HKLM Issues
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
off topic note.

jack, I reopened the ozzy-page and it was pushing gator. me not likey spyware.
_________________________
!

download KiXnet

Top
#72789 - 2003-01-31 07:13 PM Re: Writing WriteValue in HKLM Issues
Jack Lothian Offline
MM club member
*****

Registered: 1999-10-22
Posts: 1169
Loc: Ottawa,Ontario, Canada
Jens,

See Jooel's note:

http://www.kixtart.org/board/ultimatebb.php?ubb=get_topic;f=14;t=000393

He is correct, I tried the link its dead.
_________________________
Jack

Top
#72790 - 2003-01-31 07:16 PM Re: Writing WriteValue in HKLM Issues
Jack Lothian Offline
MM club member
*****

Registered: 1999-10-22
Posts: 1169
Loc: Ottawa,Ontario, Canada
Jooel,

My thought also but it was the best reference I found. It gives more detail than any other reference I found.

There are actually dozens of sites with the info but this was the best I found.

All seem to agree the registry key locations given above are not correct.
_________________________
Jack

Top
#72791 - 2003-01-31 07:19 PM Re: Writing WriteValue in HKLM Issues
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
not sure... who knows the debts of windows registry.

but the faq-topic was actually good:
"use proper policies instead of reg-hacks"

normal users don't have rights to write in HKLM on NT-based machines.
_________________________
!

download KiXnet

Top
#72792 - 2003-01-31 09:41 PM Re: Writing WriteValue in HKLM Issues
Jbutler Offline
Fresh Scripter

Registered: 2003-01-10
Posts: 11
Is there a such a thing of how many total characters you can put in the LegalNoticeCaption? I am tryingt to put alot of info in that. If there is a limit, Is there anyway to Expand that limit of characters?? thanks for replies?
Top
#72793 - 2003-01-31 09:50 PM Re: Writing WriteValue in HKLM Issues
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
The limit is based on the underlying messagebox. It might be at around 1000 characters.

However, I doubt the effectiveness of this method as nobody is going to read it especially if it is too long. Also, only people logging in interactively would see this message but not people who gain remoter access. Finally, this thing is absolutely annoying and you won't make a lot of friends with this.

A better solution is to have a written policy trhat every employee has to sign. This policy will hold up in court if worded correctly as the employee acknowledges to adhere to the policy by signing it, thus creating a contract-like agreement.

Search the KiXtart BBS as we've already had a couple of discussions about this.
_________________________
There are two types of vessels, submarines and targets.

Top
#72794 - 2003-02-03 11:12 PM Re: Writing WriteValue in HKLM Issues
Jack Lothian Offline
MM club member
*****

Registered: 1999-10-22
Posts: 1169
Loc: Ottawa,Ontario, Canada
Following the direction of Jens' comments, where I work they make us read & accept an HTML page on proper policies every quarter. IF you don't access & accept the policy after 3 warnings your account is de-activated.
_________________________
Jack

Top
#72795 - 2003-02-04 01:38 PM Re: Writing WriteValue in HKLM Issues
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
Just an FYI on registry value limits..

We were upgrading a system from NT4 to 2K and it would fail every time with a Stop-50 error. The tech spent about 80 hours troubleshooting it over a period of time. My colleague and I reviewed it and felt it was a registry issue, although we couldn't put our fingers on it. A senior MS engineer took a registry dump and found that there was a LARGE value that was overflowing a buffer. Apparently, during the upgrade process, the buffer used to read the registry is limited to about 512 bytes.

If you are doing upgrades, you might consider using a kix script to scrub certain keys that can easily be replaced, such as the logon message, and - as in our case - the list of allowed tcp and udp ports. This greatly simplified our upgrade task over the past year.

Granted, it's a special case, but worth filing in the back of your mind. *(yes, we're still migrating to 2K - Arrgh!)

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

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
1 registered (Allen) and 1607 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.074 seconds in which 0.029 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