Page 1 of 1 1
Topic Options
#112885 - 2004-01-30 10:49 PM UDF calls inconsistent?
cwhitmore Offline
Starting to like KiXtart

Registered: 2001-05-23
Posts: 102
Loc: Austin, Texas, USA
I'm able to call PriMapState and ComputerInGroup, but WMIQuery and AddPrinter won't work unless I put the code directly into my Kix script.
I've tried switching from 4.22 back to 4.21, but that didn't make a difference.
Any ideas?

Top
#112886 - 2004-01-30 11:08 PM Re: UDF calls inconsistent?
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
See our fine FAQ Forum under How to use UDFs
_________________________
There are two types of vessels, submarines and targets.

Top
#112887 - 2004-01-30 11:39 PM Re: UDF calls inconsistent?
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
Isnt AddPrinter() a built in function? Why would you be calling it?
Top
#112888 - 2004-01-31 12:23 AM Re: UDF calls inconsistent?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
my idea would be a request for sample how do you use the udfs.
how do you call them and utilize and so on.
_________________________
!

download KiXnet

Top
#112889 - 2004-01-31 01:05 AM Re: UDF calls inconsistent?
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Quote:

Isnt AddPrinter() a built in function?



No, it is not but AddPrinterConnection() is.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#112890 - 2004-01-31 02:03 AM Re: UDF calls inconsistent?
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
oh yea...I dont know what I was thinking...
Top
#112891 - 2004-01-31 09:06 PM Re: UDF calls inconsistent?
cwhitmore Offline
Starting to like KiXtart

Registered: 2001-05-23
Posts: 102
Loc: Austin, Texas, USA
Here is what my script looks like: (I left out the functions WMIQuery and AddPrinter to save space)

Call '@\functions\PriMapState.udf'
Call '@\functions\ComputerInGroup.udf'

;IT group login
If ComputerInGroup('TestGroup') = 1
If PriMapState('\\servre1\HP4000N-IT') = 0
AddPrinterConnection ("\\server1\HP4000N-IT")
EndIf
If PriMapState('\\server1\Canon 5020') = 0
AddPrinterConnection ("\\server1\Canon 5020")
EndIf
EndIf
;El Paso Office
If ComputerInGroup('TestGroup') = 1
AddPrinter("192.168.5.200","HP LaserJet 4000 Series PS",,"EP-4000N in Recpt.")
EndIf


;Get system Info
$model = WMIQuery("Model","Win32_ComputerSystem")[0]
$memory = MemorySize()
$ServiceTag = WMIQuery("SerialNumber","Win32_SystemEnclosure")[0]


;Write to publidr\pcinventory.txt and touch c:\cputest.txt after inventory
If NOT Exist("c:\cputest.txt")
$RC=RedirectOutput("p:\pcinventory.txt")
"@Monthno/@Mdayno/@YEAR"+" PC Name:"+@WKSTA + " CPU:" + $model + " Memory:" + $memory + "MB" + " Service Tag:" + $ServiceTag ?
$RC=RedirectOutput("")
$TRC=RedirectOutput("c:\cputest.txt")
"DO NOT DELETE THIS FILE - Part of CPU test 01/27/2004" ?
$TRC=RedirectOutput("")
EndIf
MessageBox ("Login successful", "Scripts",1,3)
Exit



Top
#112892 - 2004-02-01 12:50 AM Re: UDF calls inconsistent?
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
What is '@\' supposed to represent?

Call '@\functions\PriMapState.udf'
Call '@\functions\ComputerInGroup.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
#112893 - 2004-02-01 01:07 AM Re: UDF calls inconsistent?
maciep Offline
Korg Regular
*****

Registered: 2002-06-14
Posts: 947
Loc: Pittsburgh
I asked the same question here
_________________________
Eric

Top
#112894 - 2004-02-01 01:45 AM Re: UDF calls inconsistent?
cwhitmore Offline
Starting to like KiXtart

Registered: 2001-05-23
Posts: 102
Loc: Austin, Texas, USA
Oops, I think I mistyped what I saw in the FAQ for "How to use UDF's". I'll change it to:
Call "functions\PriMapState.udf"
Call "functions\ComputerInGroup.udf"

...and see if it works.
Thanks for pointing out another stupid mistake on my part.
Can't quit see thru the trees
Carlton.


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 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.076 seconds in which 0.037 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