Page 1 of 1 1
Topic Options
#210520 - 2015-08-13 04:27 AM Trying run Kixtart on my company
Luke_Chim Offline
Fresh Scripter

Registered: 2015-08-13
Posts: 10
Loc: Hong Kong
Hello All,

I want to use Kixtart to repast all bat script and I have copy some script on website but still fail, May I show you my kixtart.kix script and let me get back where of my error?

I have add "KIX32 /F" on my AD profile logon script, AD function level is Windows 2000,

My Kixtart code:
 Code:
dim $i, $Text, $Drives, $Queues, $Groups, $Grp, $ExistQ, $x, $local, $remote

$Groups = EnumDomainGroups("intra")
$ExistQ = EnumPrinterConnections


; Department-specific settings
select
;--------------------------------------------------------------------------------
  case ingroup("kixtest")


    $Drives = "J:", "\\vditd002\install",

        
    $Queues = "\\XEROXPRINTSRV\FX-Universal",

    NetworkPrinters($Queues, 1, $ExistQ)
;--------------------------------------------------------------------------------
endselect

exit


Edited by Allen (2015-08-13 06:30 AM)
Edit Reason: added code tags

Top
#210521 - 2015-08-13 05:30 AM Re: Trying run Kixtart on my company [Re: Luke_Chim]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
ok...
lets start with simple stuff.
before answering your question more thoroughly after getting my laptop plugged in, I will have to ask you to use the code tags ( when you are entering code, click the # sign).

it makes it way more readable for us all. thanks for your understanding.

and lastly, I do have an idea what your issue is, but you did not state any specific error. may I quess it is the printer connection part?

what is networkprinters()? sounds like an udf name but the UDF is not shown in your post.
_________________________
!

download KiXnet

Top
#210522 - 2015-08-13 08:26 AM Re: Trying run Kixtart on my company [Re: Lonkero]
Luke_Chim Offline
Fresh Scripter

Registered: 2015-08-13
Posts: 10
Loc: Hong Kong
Hello Lonkero,

Sorry for my late response, I don't know what is "NetworkPrint" actually \:\) , It just copy from other site, my requirement just want to identify login member of group and users will according the group as map network drives and network printer,

If "NetworkPrint" is no need actually I will delete.

Thank you Lonkero!

 Originally Posted By: Lonkero
ok...
lets start with simple stuff.
before answering your question more thoroughly after getting my laptop plugged in, I will have to ask you to use the code tags ( when you are entering code, click the # sign).

it makes it way more readable for us all. thanks for your understanding.

and lastly, I do have an idea what your issue is, but you did not state any specific error. may I quess it is the printer connection part?

what is networkprinters()? sounds like an udf name but the UDF is not shown in your post.

Top
#210531 - 2015-08-14 12:42 AM Re: Trying run Kixtart on my company [Re: Luke_Chim]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
Ok. I don't know did you get anything done yet, but, you should download kixtart and open the manual on use and addprinterconnection as well as ingroup()

Kixtart is so easy it will blow your mind away.
_________________________
!

download KiXnet

Top
#210533 - 2015-08-14 05:34 AM Re: Trying run Kixtart on my company [Re: Lonkero]
Luke_Chim Offline
Fresh Scripter

Registered: 2015-08-13
Posts: 10
Loc: Hong Kong
Thanks Lonkero,

for your suggestion I have modify the code of kixtart.kix but seems not work on current version. use back to old version can connect network driver and printer.

show my current code:

 Code:
dim $i, $Text, $Drives, $Queues, $Groups, $Grp, $ExistQ, $x, $local, $remote

;$Groups = EnumDomainGroups("intra")
;$ExistQ = EnumPrinterConnections

select
;--------------------------------------------------------------------------------
case  ingroup("APVC4475_ADV056R_BW")

ADDPRINTERCONNECTION ("\\FXPRINTSVR1\APVC4475_ADV056R_BW$")


;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
case  ingroup("APVC4475_ADV056R_COLOR")

ADDPRINTERCONNECTION ("\\FXPRINTSVR1\APVC4475_ADV056R_COLOR$")


;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
case  ingroup("APVC4475_ADV058R_BW")

ADDPRINTERCONNECTION ("\\FXPRINTSVR1\APVC4475_ADV058R_BW$")

;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
case  ingroup("APVC4475_ADV058R_COLOR")

ADDPRINTERCONNECTION ("\\FXPRINTSVR1\APVC4475_ADV058R_COLOR$")

;--------------------------------------------------------------------------------

; Department-specific settings
;--------------------------------------------------------------------------------
  case ingroup("kixtest")


USE J: "\\vditd002\install"
ADDPRINTERCONNECTION ("\\XEROXPRINTSRV\FX-Universal")
        

;--------------------------------------------------------------------------------
endselect
exit





 Originally Posted By: Lonkero
Ok. I don't know did you get anything done yet, but, you should download kixtart and open the manual on use and addprinterconnection as well as ingroup()

Kixtart is so easy it will blow your mind away.

Top
#210537 - 2015-08-14 03:00 PM Re: Trying run Kixtart on my company [Re: Luke_Chim]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
Do you belong to more than one group? Select is first match only.
_________________________
!

download KiXnet

Top
#210548 - 2015-08-18 04:16 AM Re: Trying run Kixtart on my company [Re: Lonkero]
Luke_Chim Offline
Fresh Scripter

Registered: 2015-08-13
Posts: 10
Loc: Hong Kong
hello Lonkero

I change some to If and endIf for some DEPT much loop with them, it is okay.

May I know more for kixtart.kix, If want type cmd command should below?

 Code:
 SHELL “CMD.EXE /C ” 


 Originally Posted By: Lonkero
Do you belong to more than one group? Select is first match only.

Top
#210549 - 2015-08-18 04:37 AM Re: Trying run Kixtart on my company [Re: Luke_Chim]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
your shell line will work 90% of time.
to make it 100%, I would still urge you to use:
 Code:
shell '%comspec% /c your_commandline_what_ever_it_might_be'


I have not run into it in a long time (maybe because by habit I always use comspec?) but in theory you could have issues of cmd.exe not reside in the path.

that is just cutting hairs now though, in the ages on win9x and win3.x it mattered more.

oh, and if you don't want your script to output 0 or 1 on the console, you can prepend your FUNCTION calls with simple $notcare=

so, for addprinterconnection() you would say:
 Code:
$IdontCare=addprinterconnection('\\server\share')


now, if you do care, you could do:
 Code:
$IdoCare=addprinterconnection('\\server\SHARE')
if $IdoCare
  'I could not connect you to SHARE printer. complain to your admin, he might care about: ' @serror ?
endif

_________________________
!

download KiXnet

Top
#210551 - 2015-08-18 07:15 AM Re: Trying run Kixtart on my company [Re: Lonkero]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4562
Loc: USA
What if you only cared a little? \:\)
Top
#210552 - 2015-08-18 12:10 PM Re: Trying run Kixtart on my company [Re: Allen]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4401
Loc: New Jersey
$Imightcare, $IKindaCare, or $MaybeICare might be good choices.. \:D
_________________________
Actually I am a Rocket Scientist! \:D

Top
#210553 - 2015-08-18 01:39 PM Re: Trying run Kixtart on my company [Re: Glenn Barnas]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
Don't forget KiX = @CareWare
Top
#210555 - 2015-08-19 06:17 AM Re: Trying run Kixtart on my company [Re: Lonkero]
Luke_Chim Offline
Fresh Scripter

Registered: 2015-08-13
Posts: 10
Loc: Hong Kong
Hello Lonkero,

Sure modify CMD.EXE to %comspec% completed, Thank you

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 874 anonymous users online.
Newest Members
StuTheCoder, M_Moore, BeeEm, min_seow, Audio
17884 Registered Users

Generated in 0.133 seconds in which 0.096 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