Page 2 of 2 <12
Topic Options
#71389 - 2002-11-06 10:50 PM Re: Off topic about pc serial...
Waltz Offline
Seasoned Scripter

Registered: 2002-08-01
Posts: 485
Loc: Waterloo, Ontario, Canada
FWIW, if Saleem's posted code of 6 Nov @ 18:44 is 'unscrambled' it works just fine...
_________________________
We all live in a Yellow Subroutine...

Top
#71390 - 2002-11-07 06:21 AM Re: Off topic about pc serial...
Saleem Offline
Hey THIS is FUN
*

Registered: 2001-04-11
Posts: 280
Loc: UAE
Fine sory for that thred

Now just two 3 things to confirm

? @kix
? WMIQuery("SerialNumber","Win32_BIOS")
? @Serror

exit
;****************************************************************************************************
FUNCTION WMIQuery($what,$from,optional $computer,optional $where, optional $x)
dim $strQuery, $objEnumerator, $value
if not $computer $computer="@WKSTA" endif
$strQuery = "Select $what From $from"
if $where and $x $strQuery = $strQuery + " Where $where = '$x'" endif
$SystemSet = GetObject("winmgmts:{impersonationLevel=impersonate}!//$computer")
$objEnumerator = $SystemSet.ExecQuery($strQuery)
For Each $objInstance in $objEnumerator
If @Error = 0 and $objInstance <> ""
$=execute("$$value = $$objInstance.$what")
$WMIQuery="$value"+"|"+"$WMIQuery"
EndIf
Next
$WMIQuery=left($WMIQuery,len($WMIQuery)-1)
exit @error
ENDFUNCTION

what I have to assign in $what $from , optional $computer, optional and $where and $x

what about dim $strquery, and othere variables
_________________________
“I’ll not change you unless you don’t have intention to change yourself” --H:Quran

Top
#71391 - 2002-11-07 03:03 PM Re: Off topic about pc serial...
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
...again with the long lines. Please keep them short.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#71392 - 2002-11-07 03:40 PM Re: Off topic about pc serial...
Sealeopard Offline
KiX Master
*****

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

Could you please do your homework before your next post?

Please read ABC's of KiXtart board etiquette and message to new forum users since it explains how to post f!@#$ing
code the correct way, and keep the lines shorter by NOT posting 500 '*'s in a comment line.

Also, if you would take a look at the WMIQuery function header, it does explain what to assign those variables. $computer
obviously assigns an optional computername (for remote queries) and $where and $x limit the query to 'WHERE $where=$x'.

The UDF is pre-packaged, if you will, so you don't need to mess arounf with anything inside the UDF. Just
use it as specified in How to use UDFs

[ 07. November 2002, 15:41: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.

Top
#71393 - 2002-11-09 07:32 AM Re: Off topic about pc serial...
Saleem Offline
Hey THIS is FUN
*

Registered: 2001-04-11
Posts: 280
Loc: UAE
Sorry again

Thanx for the responses guys.. It worked with SMBIOS utility since I am using kix 3.63 I cannot use WMI fuction,s But I I'll do this very sooooon...

Thank u again
_________________________
“I’ll not change you unless you don’t have intention to change yourself” --H:Quran

Top
#71394 - 2002-11-10 03:33 AM Re: Off topic about pc serial...
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
It is highly recommended to upgrade to KiXtart 4.x, especially if you have to support Windows 2000/XP or even AD. KiXtart 3.x also doesn't support UDFs.

BTW, it would have been nice if you would have stated upfront that you are using (legacy) KiXtart 3.63 scripts.
_________________________
There are two types of vessels, submarines and targets.

Top
#71395 - 2002-12-10 06:50 PM Re: Off topic about pc serial...
MCA Offline
KiX Supporter
*****

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

We advice to use the OsID.kix UDF from this board, when you are running KiXtart 4.x
release.
Our version os.kix run also on earlier kixtart releases, but using an UDF makes
your code easier to read and to maintain.
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 2 of 2 <12


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 978 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.058 seconds in which 0.024 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