Page 1 of 1 1
Topic Options
#22196 - 2002-05-27 02:03 PM Kixtart displays 000000
vanloon Offline
Fresh Scripter

Registered: 2002-05-27
Posts: 34
Hi there,

Ik have a couple of statements like "if returncode <> 0". When the user logs on the network they get to see about 10 zero's. It is not terrible, but it would look nicer when they do not see the zero's at all.

Does somebody know how I can adjust the script so that they do not see them anymore??

Thanks,

Michel

Top
#22197 - 2002-05-27 02:08 PM Re: Kixtart displays 000000
MCA Offline
KiX Supporter
*****

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

Welcome to the board.

It had to deal with the way you are using functions. See for the
complete story
Suppressing Results when running scripts
on FAQ forum.
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
#22198 - 2002-05-27 02:47 PM Re: Kixtart displays 000000
vanloon Offline
Fresh Scripter

Registered: 2002-05-27
Posts: 34
Hi,

This does work for the "write value" command, but not for the "use" command.

this works:

$NoSaveSettingshklm=ExistKey("HKEY_LOCAL_MACHINE\Software\Microsoft\windows\currentversion\explorer")
If $NoSaveSettingshklm = 0
$temp = WriteValue("HKEY_LOCAL_MACHINE\Software\Microsoft\windows\currentversion\explorer","NoSaveSettings","1","REG_DWORD")
Endif

But this does not work:
$returncode = delkey ("hkey_current_user\network\h")
if $returncode = 0
? "key deleted...."
endif
$temp = use h: "$gbr"

Can you help me??

Thanks,

Michel

Top
#22199 - 2002-05-27 02:50 PM Re: Kixtart displays 000000
MCA Offline
KiX Supporter
*****

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

USE isn't a function but a KiXtart command. Calling it as "$temp=USE ..." isn't legal.

USE can be used like:
code:
 USE X: \\servername\share
IF (@error <> 0)
? "Warning KIX: mapping problem."
ENDIF

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
#22200 - 2002-05-27 03:05 PM Re: Kixtart displays 000000
vanloon Offline
Fresh Scripter

Registered: 2002-05-27
Posts: 34
Hi,

But the use command also gives a zero. Do u know how I can prevent this from happening??

Thanks

Top
#22201 - 2002-05-27 03:07 PM Re: Kixtart displays 000000
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
The USE command does not return a zero to the console. The zero must come from somewhere else.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#22202 - 2002-05-27 03:09 PM Re: Kixtart displays 000000
MCA Offline
KiX Supporter
*****

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

Another idea,
code:
$null=RedirectOutput("nul")
;
; - use commands -
;
USE X: "\\servername\share"
;
$null=RedirectOutput("")

greetings.

btw: can you put your script part which handles
about USE commands on the board. Possible it is
something else which generates those ZEROs.
_________________________
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
#22203 - 2002-05-27 03:15 PM Re: Kixtart displays 000000
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
vanloon:

Please post your code so we can examine it to find where the offending '0' is coming from. As LIgetfa already stated the USE command does not return anything. You might have used other KiXtart functions that return a success/error code which you haven't assigned to a variable.

It is good KiXtart programming practices to assign variables to all return codes, most people use $rc or $retcode for this.

Please read also the following FAQs:
(mis)use of quotes
Why does the console display zeros and ones (amongst others)?
Sequence of events during logon
How do we check and format code for scripts?
_________________________
There are two types of vessels, submarines and targets.

Top
#22204 - 2002-05-27 03:29 PM Re: Kixtart displays 000000
vanloon Offline
Fresh Scripter

Registered: 2002-05-27
Posts: 34
This is the code:

$grp=$srvr+$j
$gbr=$srvr+$h+$x
$apps=$srvr+$y

;
; Maak mappings en verwijder indien aanwezig
;

$returncode = delkey ("hkey_current_user\network\h")
if $returncode = 0
? "key deleted...."
endif
use h: "$gbr"

$returncode = delkey ("hkey_current_user\network\j")
if $returncode = 0
? "key deleted...."
endif
use j: "$grp"

$returncode = delkey ("hkey_current_user\network\y")
if $returncode = 0
? "key deleted...."
endif
use y: "$apps"

Thanks

Top
#22205 - 2002-05-27 03:51 PM Re: Kixtart displays 000000
vanloon Offline
Fresh Scripter

Registered: 2002-05-27
Posts: 34
Sorry,

It all where write value reactions. It is resolved now. Thanks for the help.

Michel

Top
#22206 - 2002-05-27 04:48 PM Re: Kixtart displays 000000
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Instead of deleting the registry keys, you should use
code:
; delete just the J: drive
USE J: /delete /persistent
; delete all mapped drives
USE '*' /delete /persistent
; create persistent mapping to J:
USE J: \\server\share /persistent

which is a cleaner way of doing it.
_________________________
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 735 anonymous users online.
Newest Members
JimDunn, fgarcia, Viginette, ManuvdWielNL, Sir_Barrington
17890 Registered Users

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