Page 1 of 1 1
Topic Options
#9416 - 2001-06-11 06:15 PM Problem with ENUMVALUE() on Win95
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
I've run into a problem with ENUMVALUE() on Win 95 machines. I wrote the script on Win2k and it tests out fine on Win2k as well. I clipped the section of code that's giving me grief below.
<snip>
;-----------------------------------------------------------------------------------
; Find and remove 'Machine Debug Manager' from RunServices key
$Index = 0
:Loop1
$ValueName = ENUMVALUE("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunServices\", $Index)
If @ERROR = 0
? "Name found: $ValueName"
If $ValueName = "Machine Debug Manager"
$ReturnCode = DelValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunServices", "Machine Debug Manager")
If $ReturnCode = 0
? "$ValueName deleted"
goto Done
Endif
Endif
$Index = $Index + 1
goto Loop1
Endif
;-----------------------------------------------------------------------------------
one
</snip>

The problem is ENUMVALUE()returns nothing. This I deduced through debug and remmed lines. @ERROR returns 0. $ValueName is blank.

Any ideas?

------------------
Laziness is the mother of invention

Les Ligetfalvy

_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#9417 - 2001-06-11 06:37 PM Re: Problem with ENUMVALUE() on Win95
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Further to this thread. Typo on @ERROR returned. It is 1. My Done label got obscured by a smiley. Also should note I'm running KiX 3.62 and the results are the same whether I run it in the logon script or not.

------------------
Laziness is the mother of invention

Les Ligetfalvy

_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#9418 - 2001-06-11 06:57 PM Re: Problem with ENUMVALUE() on Win95
kholm Offline
Korg Regular
*****

Registered: 2000-06-19
Posts: 714
Loc: Randers, Denmark
Les,

You have to remove the trailing backspace in keyname.

Call of enumvalue should be:

code:

$ValueName = ENUMVALUE("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunServices", $Index)


Erik

Top
#9419 - 2001-06-11 07:52 PM Re: Problem with ENUMVALUE() on Win95
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Erik,
Thanks for the help. That did it! JIC anyone's curious as to what this script is for, it is in response to TechNet article:
OFF2000: Files That Begin with "fff" Appear in Windows Folder [Q221438]
I have hundreds of network client machines slowing to a crawl from all the temp files created by MDM. This will take care of them (there's also lines to delete the fff*.tmp files) in one fell swoop.

Thanks again,

------------------
Laziness is the mother of invention

Les Ligetfalvy

_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

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 2419 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.06 seconds in which 0.033 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