Page 1 of 1 1
Topic Options
#155377 - 2006-01-16 03:19 AM How do i call an udf when i run kix32.exe
Orion88 Offline
Fresh Scripter

Registered: 2006-01-13
Posts: 5
Hi, i am new to kix and i have a question on how how to call a udf when i run kix32.exe. I have no problem running *.kix files. Sorry if this seems to be a silly question. Thanks for any help rendered.
Top
#155378 - 2006-01-16 03:24 AM Re: How do i call an udf when i run kix32.exe
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
call '\\server\share\folder\file.udf'
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#155379 - 2006-01-16 03:39 AM Re: How do i call an udf when i run kix32.exe
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11629
Loc: CA
Please take a look at these resources.


How to use UDFs
http://www.kixtart.org/ubbthreads/showflat.php?Cat=&Number=81594

How to run my first UDF
http://www.kixhelp.com/tutorial/UDF-001.htm
 

Let us know if either of these resources are unable to help you sort out using UDF scripts.
 

Top
#155380 - 2006-01-16 10:43 AM Re: How do i call an udf when i run kix32.exe
Orion88 Offline
Fresh Scripter

Registered: 2006-01-13
Posts: 5
Erm...still looks a bit complicated to me. I was only trained in VB. Sorry...
How abt an example, say if i have a logon script and i want to make use of the GetNavInfo udf, how do i call this udf? For my logon script, i nd to find out if a particular application is installed and if not , proceed to install it. Thanks.

Top
#155381 - 2006-01-16 10:51 AM Re: How do i call an udf when i run kix32.exe
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
An example using the GetNavAntiVirusInfo() UDF. Taken from the UDF header.
GetNavAntiVirusInfo() - Returns Information and Date of installed Symantec AntiVirus

You need to get the UDF and place it in the drive specified in the call.

Code:

Break On

Call @LDRIVE + "\functions\GetNavAntiVirusInfo().udf"

$nul=SetOption('WrapAtEOL','ON')
$nul=SetOption('Explicit','ON')
$nul=SetOption('NoVarsInStrings','ON')

Dim $NAVInfo

$NAVInfo = GetNavAntiVirusInfo('NTDOCWORK1','5',,)
? 'Host Name: '+$NAVInfo[5]
? 'Engine Ver: '+$NAVInfo[0]
? 'Def Date: '+$NAVInfo[1]
? 'Parent Server: '+$NAVInfo[2]
? 'Client Type: '+$NAVInfo[3]
? 'Install Folder: '+$NAVInfo[4]



Edited by Mart (2006-01-16 10:52 AM)
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#155382 - 2006-01-16 10:52 AM Re: How do i call an udf when i run kix32.exe
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
afaik, you have 100% thing in vbscript.

place the UDF code somewhere in your script and call it like any other inbuild or user defined function.
and in how to use UDFs, it's so simply put that I have no idea how anyone can say it looks complicated.
_________________________
!

download KiXnet

Top
#155383 - 2006-01-16 08:11 PM Re: How do i call an udf when i run kix32.exe
StarwarsKid Offline
Seasoned Scripter
*****

Registered: 2005-06-15
Posts: 506
Loc: Oregon, USA
Here's one of my simple examples.
Code:
SLEEP 5
call "@ScriptDir\UDF\label.udf"
if ingroup ("IS")
$RC = label(G:\,ISDept) ; Drive letter renaming function
$RC = label(H:\,@UserID) ; Drive letter renaming function
$RC = label(I:\,AllShare) ; Drive letter renaming function
$RC = label(X:\,Application) ; Drive letter renaming function
endif

exit

_________________________
let the wise listen and add to their learning,
and let the discerning get guidance- Proverbs 1:5

Top
#155384 - 2006-01-16 08:47 PM Re: How do i call an udf when i run kix32.exe
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Woops. I see a macro in a string

Code:

....
call "@ScriptDir\UDF\label.udf"
....

_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#155385 - 2006-01-16 08:58 PM Re: How do i call an udf when i run kix32.exe
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11629
Loc: CA
LOL

call @ScriptDir+"\UDF\label.udf"

Top
#155386 - 2006-01-16 08:58 PM Re: How do i call an udf when i run kix32.exe
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
starwarskid, your example has 14 missing quotes!

when posting examples, please try to use correct syntax (I know, even the oldies fail sometimes, but this one is too obvious)
_________________________
!

download KiXnet

Top
#155387 - 2006-01-16 09:05 PM Re: How do i call an udf when i run kix32.exe
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Quote:

starwarskid, your example has 14 missing quotes!
....






Wow you're busted on this one SWK
Did this once myself (by accident surely) and I also got some heat from Jooel
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

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

Generated in 0.097 seconds in which 0.061 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