Page 1 of 1 1
Topic Options
#20181 - 2002-04-19 09:35 AM delvalue not working
GrahamA Offline
Lurker

Registered: 2002-04-18
Posts: 2
I`m new to kixtart and am having troubles with a script i`m writing, every time i run it on a win98 machine it tells me there is an error in the parameters on the delvalue command though using the same command on a win2k works properly. Is there something obvious i'm missing or what? Anyway here's the code and thanks for any help.
$index=0
$key=0
$currip=0
$err=0

If @INWIN <> 1 ; check windows version
$key=EnumKey(hkey_local_machine\system\currentcontrolset\services\class\nettrans,$index)
$err=@ERROR
$currip=ReadValue('hkey_local_machine\system\currentcontrolset\services\class\nettrans\$key','ipaddress')
If $err=0 AND $currip<>'0.0.0.0'; check it needs changing and perform changes
WriteValue('hkey_local_machine\system\currentcontrolset\services\class\nettrans\$key','ipaddress','0.0.0.0','reg_sz')
WriteValue('hkey_local_machine\system\currentcontrolset\services\class\nettrans\$key','ipmask','0.0.0.0','reg_sz')
WriteValue('hkey_local_machine\system\currentcontrolset\services\vxd\mstcp','enabledns','0','reg_sz'
DelValue('hkey_local_machine\system\currentcontrolset\services\vxd\mstcp','nameserver')
EndIf
EndIf

Exit

Top
#20182 - 2002-04-19 10:08 AM Re: delvalue not working
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Graham,

welcome to the board !

Hmmm ... have you verified that the regpath is the same for 9x ???
Seems to me that your code is not the cause !

btw. : to suppress console output (return values of functions) add a 'nulifier' before functions like :

$nul = function(param)

hth

Jochen
_________________________



Top
#20183 - 2002-04-19 10:12 AM Re: delvalue not working
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Plus :

you missed the closing bracket in your last WriteValue statement ...

Ok, it may be a typo , otherwise it won't work on W2K , no ?

J.
_________________________



Top
#20184 - 2002-04-19 10:18 AM Re: delvalue not working
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
oops,

it won't execute the part on W2K because @inwin on W2k is 1 !

It is skipped by your if @inwin <> 1 statement [Big Grin]

so the missing closing bracket is it ?

J.
_________________________



Top
#20185 - 2002-04-19 10:35 AM Re: delvalue not working
GrahamA Offline
Lurker

Registered: 2002-04-18
Posts: 2
Thanks mate. I can`t believe it 4hrs of looking and i miss a damn bracket [Smile] As far as 2k goes i just copied and pasted that line into a seperate program and ran it from there, anywaqy thanks again.
Top
#20186 - 2002-04-20 09:31 PM Re: delvalue not working
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear GrahamA,

Also welcome to the board.

What apity it cost four hours. With our kixstrip tool you can verify
your script for such errors.
Currently there are three versions
  • kixstrip363.exe (= kixtart 3.63)
  • kixstrip400.exe (= kixtart 4.00, 4.01, 4.02)
  • kixstrip410.exe (= kixtart 4.10 build 84)
Our call kixstrip input.kix output.kix /block_check /show_errorswill result in:
code:
 $index=0
$key=0
$currip=0
$err=0

IF @inwin <> 1 ; check windows version
$key=EnumKey(hkey_local_machine\system\currentcontrolset\services\class\nettrans,$index)
$err=@error
$currip=ReadValue('hkey_local_machine\system\currentcontrolset\services\class\nettrans\$key','ipaddress')
IF $err=0 AND $currip<>'0.0.0.0'; check it needs changing and perform changes
WriteValue('hkey_local_machine\system\currentcontrolset\services\class\nettrans\$key','ipaddress','0.0.0.0','reg_sz')
WriteValue('hkey_local_machine\system\currentcontrolset\services\class\nettrans\$key','ipmask','0.0.0.0','reg_sz')
WriteValue('hkey_local_machine\system\currentcontrolset\services\vxd\mstcp','enabledns','0','reg_sz'
; -------> Warning KIXSTRIP: 13 line incomplete "left parenthesis".
; -------> Warning KIXSTRIP: 13 line incompleted.
DelValue('hkey_local_machine\system\currentcontrolset\services\vxd\mstcp','nameserver')
ENDIF
ENDIF

EXIT

;($begin)
;
; sat 20-apr-2002 10:01:34 (kix 4.10 vs 3.04e)
;
;Summary KIXSTRIP: block structures
; - do:until [0:0]
; - for|each:in|to:step|next [0|0:0|0:0|0]
; - function:endfunction [0:0]
; - if:else:endif [2:0:2]
; - select:case:endselect [0:0:0]
; - while:loop [0:0]
;Warning KIXSTRIP: 1 line is incompleted.
;Warning KIXSTRIP: some lines contains errors or possible errors.
; 1 line incomplete "left parenthesis".
; 1 line incompleted.
;Informative KIXSTRIP: 2 block_structures found.
;Informative KIXSTRIP: no UDF's found.
;Informative KIXSTRIP: no labels found.
;Summary KIXSTRIP: BREAK CALL DEBUG DISPLAY ENDFUNCTION EXECUTE EXIT FUNCTION GET GETS GOSUB GOTO OLExxx PLAY QUIT RETURN RUN SHELL SLEEP THEN USE
;Informative KIXSTRIP: 1 EXIT
;
;($end)
;($begin)
;
;Warning KIXSTRIP: 13 line incomplete "left parenthesis".
;Warning KIXSTRIP: 13 line incompleted.
;
;($end)

greetings.
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

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

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