Page 1 of 1 1
Topic Options
#52058 - 2000-11-01 06:27 PM Counter
Anonymous
Unregistered


Every now and then we need to display a short message, all users have to read it once. So I came up with the following script:

$Counter=1
$Message=readvalue("HKEY_CURRENT_USER\Autom","Test")
if $Message < $counter
shell "notepad.exe"
writevalue("HKEY_CURRENT_USER\Autom","Test","$Counter","REG_DWORD")
endif

It works great. But when the counter becomes greater then 9 it stops.

Can someone help me out?

Thanx, Hans.

Top
#52059 - 2000-11-01 08:30 PM Re: Counter
BoxKite Offline
Da Box
*****

Registered: 2000-05-17
Posts: 282
Loc: Vacaville,CA,USA
Go to this site:
http://www.microsoft.com/TechNet/winnt/Winntas/manuals/concept/xcpaa.asp

I think the problem is you are using REG_DWORD, and you should be using REG_SZ.

Luck

------------------
BoxKite
FACTA NON VERBA

_________________________
Box
FACTA NON VERBA

Top
#52060 - 2000-11-01 09:16 PM Re: Counter
Anonymous
Unregistered


No, doesn't work.....

PS we have win95 clients but I don't think that's the problem.

Top
#52061 - 2000-11-01 10:03 PM Re: Counter
BoxKite Offline
Da Box
*****

Registered: 2000-05-17
Posts: 282
Loc: Vacaville,CA,USA
Here's what I did:
I created the following value in my NT registry:

HKEY_CURRENT_USER\Autom\Test, type REG_SZ, initial value 1

I then ran this code:

code:
$counter = 12
writevalue("HKEY_CURRENT_USER\Autom","Test","$Counter","REG_SZ")
exit

The value changed to 12

I don't know why you are getting different results

_________________________
Box
FACTA NON VERBA

Top
#52062 - 2000-11-01 10:03 PM Re: Counter
Anonymous
Unregistered


Hya (hoi) Hans..,

The problem isn't REG_DWORD or REG_SZ although REG_SZ is more friendly.
The problem is in reading $Message..!!
Try this:

$Message=VAL(READVALUE(HKEY_CURRENT_USER\Autom","Test"))

Cya (Groetjes)..,


------------------
Hope to be of service..,

Fabian.

-----------------Paranoia is reality on a finer scale-----------------

[This message has been edited by Fabian (edited 01 November 2000).]

Top
#52063 - 2000-11-01 10:13 PM Re: Counter
Anonymous
Unregistered


It works!!!!!

Thanx! (Dank je wel)

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 633 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.051 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