Page 1 of 1 1
Topic Options
#207763 - 2013-09-17 11:06 PM Noob to Kixtart
ChuckBB88 Offline
Fresh Scripter

Registered: 2012-10-09
Posts: 6
Loc: NJ, USA
Hi gang I am pretty new to using kixtart. I have a .kix file I am trying to clean and or get working. My first question is what does $M = mean? For example I have

? $MyIP
select
case $IP2 = 10
;? "Shipping"

case $IP2 = 20
;? "Education"

if $m = "AIO-WTH-GRADE-02" or $l = "PRO-FEVANS"
use Y: "\\nas6\Notebook 0910$"

I would assume that $m = the name of the PC correct? What my goal is to set network drive mapping shares based on computer name or better yet partial computer names. Any examples or info on how to do this would be great appreciated. Thanks in advance!

Top
#207770 - 2013-09-18 02:10 PM Re: Noob to Kixtart [Re: ChuckBB88]
BradV Offline
Seasoned Scripter
****

Registered: 2006-08-16
Posts: 687
Loc: Maryland, USA
Welcome to the board first. Second, have you read the manual? Lots of good information there. The $m is just a variable reference. It is just testing the contents of m against a fixed string.

Regards,

Brad

Top
#207777 - 2013-09-18 06:48 PM Re: Noob to Kixtart [Re: BradV]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
that segment looks like working code. wonder who got fired this time...
_________________________
!

download KiXnet

Top
#207781 - 2013-09-18 09:12 PM Re: Noob to Kixtart [Re: Lonkero]
ChuckBB88 Offline
Fresh Scripter

Registered: 2012-10-09
Posts: 6
Loc: NJ, USA
Thanks folks for the replies. I did briefly look at the manual, I'll have to go back to it and see if I can find help and also check why my settings aren't working. I assume what I am asking can be done. Thanks again!
Top
#207782 - 2013-09-18 09:35 PM Re: Noob to Kixtart [Re: ChuckBB88]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4403
Loc: New Jersey
Browse to the IT Resources / How To's part of my web site - you'll find a "Fundamentals of Programming" document that I use when teaching basic admin scripting - you might find it helpful.

Glenn

PS - welcome to KORG! Where in Joisey are ya?
_________________________
Actually I am a Rocket Scientist! \:D

Top
#207783 - 2013-09-18 09:36 PM Re: Noob to Kixtart [Re: Glenn Barnas]
ChuckBB88 Offline
Fresh Scripter

Registered: 2012-10-09
Posts: 6
Loc: NJ, USA
Thanks much Glenn! I am in South Jersey in Washington Twp!

Edited by ChuckBB88 (2013-09-18 09:37 PM)

Top
#207784 - 2013-09-18 09:48 PM Re: Noob to Kixtart [Re: ChuckBB88]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
I would recommend downloading the most recent version of the html based help file from the following thread. It is must easier to use when needing to quickly look up a function or command.

http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=202858#Post202858

As for your specific question, yes it's possible. Honestly just about anything is possible in kix.

The script you posted however is not complete. The $m is a variable that was created in the script, but it is never populated in the snippet that you posted. I’d guess that somewhere above the portion you posted there is a line with something like $m = @WkSta which would assign the value of the workstation macro the variable $m.

The $l variable, as well as the $IP2 and $MyIP variables are also never populated, so there is no telling where their values are coming from.

If you want to go about using a portion of a string, take a look at the SubStr(), or InStr() functions.

Just a quick example…
 Code:
$m = @WkSta

If InStr($m, "AIO-WTH-")
   Use Y: "\\nas6\Notebook 0910$"
Endif

Top
#207787 - 2013-09-19 03:31 PM Re: Noob to Kixtart [Re: ShaneEP]
ChuckBB88 Offline
Fresh Scripter

Registered: 2012-10-09
Posts: 6
Loc: NJ, USA
Shane, thanks you!!! Excellent information, I feel like I am getting somewhere now and learning. Yes above what I posted previously is the below script information. Not sure what the 1, 8 stand for in the $m line. Thanks for help!

$compname = @wksta
$userid = @userid

$o = SUBSTR($compname, 1, 3)
$n = SUBSTR($compname, 1, 7)
$m = SUBSTR($compname, 1, 8)
$l = SUBSTR($compname, 1, 9)
$k = SUBSTR($compname, 1, 10)
$i = SUBSTR($compname, 1, 11)
$h = SUBSTR($compname, 1, 12)
$g = SUBSTR($compname, 1, 13)
$u = SUBSTR($userid, 1, 6)
$v = SUBSTR($userid, 1, 8)

Top
#207788 - 2013-09-19 04:02 PM Re: Noob to Kixtart [Re: ChuckBB88]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4403
Loc: New Jersey
SubStr is a Sub-String function, it returns part of the string specified by the first argument, starting in the position specified by the second, returning the number of chars specified by the third.

if $Val = 'This is a string', then SubStr($Val, 3, 2) would return "is" from "This" - the third and fourth characters.

Glenn

PS - Bergen County / Hackensack area here..
_________________________
Actually I am a Rocket Scientist! \:D

Top
#207789 - 2013-09-19 04:07 PM Re: Noob to Kixtart [Re: Glenn Barnas]
ChuckBB88 Offline
Fresh Scripter

Registered: 2012-10-09
Posts: 6
Loc: NJ, USA
Thanks Glenn! I have a sister in law who lives in Ridgewood which I believe is Bergen county.
Top
#207790 - 2013-09-19 04:28 PM Re: Noob to Kixtart [Re: ChuckBB88]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4403
Loc: New Jersey
That's about 10-15 minutes from me.. next time you're here and bored at a family function, look me up and we'll grab a beer! \:\)
_________________________
Actually I am a Rocket Scientist! \:D

Top
#207791 - 2013-09-19 04:40 PM Re: Noob to Kixtart [Re: Glenn Barnas]
ChuckBB88 Offline
Fresh Scripter

Registered: 2012-10-09
Posts: 6
Loc: NJ, USA
Sounds good to me Glenn, I am always up for a beer and usually bored at those family functions, ha!! Take care!
Top
#207793 - 2013-09-20 11:55 AM Re: Noob to Kixtart [Re: ChuckBB88]
BradV Offline
Seasoned Scripter
****

Registered: 2006-08-16
Posts: 687
Loc: Maryland, USA
Bored with family in Jersey? Don't you guys watch TV? \:\)
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 1046 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.063 seconds in which 0.024 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org