Page 1 of 1 1
Topic Options
#201483 - 2011-02-01 08:27 PM hello, i have a problem with the next script that i made to mapping printer
jaime Offline
Fresh Scripter

Registered: 2010-10-04
Posts: 5
Loc: Colombia
hello, i have a problem with the next script that i made.

;---------------------------------------------------------------------------
;Script BUSSCAR
;----------------------------------------------------------------------------
;Programa completo para BUSSCAR DE COLOMBIA
;se cumple con políticas de seguridad establecidas tanto por la empresa
;como por el departamento de TI.
;Dentro de los servidores se han creados grupos
;-----------------------------------------------------------------------------
;Jaime Eduardo Gonzalez Restrepo
;jaimeedog@gmail.com
;-----------------------------------------------------------------------------
;Actualización 11/10/2010
;-----------------------------------------------------------------------------
;Dependencies...
;- KiXtart Version 4.10
;-
;------------------------------------------------------------------------------
;Variables Globales
;Identificanción del usuario administrador ante el equipo donde se ejecuta el Script.
$US = '%ALLUSERSPROFILE%\KiXfiles\runnas.exe /user:BUSSCAR\administrator '
;Password de administrador, esta contraseña es la del super usuario de red ***NO ES DEL EQUIPO***
$PASS = ' /password:skpc$_123 /noprofile'
;Llave de usuario actual para configuración de escritorio
$HKCU = 'HKEY_CURRENT_USER\Control Panel\Desktop'
;Llave de usuario actual para configuración de politicas
$HKCUS = 'HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System'
;Llave local del sistema para optimización del fondo dentro del escritorio
$HKLM = 'HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\OptimalLayout'
;Variable para ruta de imagenes y archivos que se usan para el kixtart
$HKMOVE = '\\scerritos0\sysvol\busscar.com.co\scripts\KixFiles\*.bmp'
;Variable para ejecutar programas al cargue del sistema
$HKRUN = 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run'
;Variable para ubicación del cursor para impresión en pantalla
$INDEX = 0
$DD = 0
$FECHA = 0
$YY = 0
$MM = 0
$MMDD = 0
DIM $CD , $USB , $RC
;----------------------------------------
$ = SetOption ("Explicit" , "On")
Break On CLS
:Start
;------------------------------------------
SetConsole ('Maximize')
SetConsole ('AlwaysOnTop')
COLOR Y+/N
; Pantalla de entrada
AT (2,10) 'BIENVENIDO A BUSSCAR DE COLOMBIA S.A'
AT (3,10) ' PEREIRA - COLOMBIA '
; Muestra la información del usuario que esta iniciando la sesión
AT (5,3) 'FECHA : ' + @DATE + ' HORA : ' + @TIME
AT (7,3) 'NOMBRE : ' + @fullname
AT (8,3) 'LOGIN : ' + @userid
AT (9,3) 'NOMBRE PC : ' + @wksta
AT (10,3) 'DOMINIO : ' + @domain
AT (11,3) 'SERVIDOR DE CONEXION : ' + @lserver

;--------------------------------------------------------------------------
;FUNTIONS
;--------------------------------------------------------------------------
;-------------------------------------------------------
;Función Impresoras de red
;Los parametros de la función son:
;\\<servicor o dirección IP>\<nombre de la impresora o nombre compartido>
;Se asigna la impresora de acuerdo a la necesidad de cada
;usuario o permisos otorgados para su uso.
;-------------------------------------------------------
FUNCTION IMPRESORAS_RED ()

DelPrinterConnection("\\scerritos0\KONICAMI_500")
AT (12 + $INDEX,3) 'BORRANDO IMPREOSRA KONIKA 500 EN SCERRITOS 0'
$INDEX = $INDEX +1

DelPrinterConnection("\\172.16.2.3\KONICAMI_500")
AT (12 + $INDEX,3) 'BORRANDO IMPREOSRA KONIKA 500 EN 172.16.2.3'
$INDEX = $INDEX +1

DelPrinterConnection("\\scerritos1\KONICAMI_500")
AT (12 + $INDEX,3) 'BORRANDO IMPREOSRA KONIKA 500 EN SCERRITOS1'
$INDEX = $INDEX +1

AddPrinterConnection("\\scerritos1\KONICAMI_500")
AT (12 + $INDEX,3) 'CONECTANDO IMPREOSRA KONIKA 500 EN SCERRITOS1'
$INDEX = $INDEX +1

DelPrinterConnection("\\172.16.2.8\KONICAMI_500")
AT (12 + $INDEX,3) 'BORRANDO IMPREOSRA KONIKA 500 IMPRESORA EN 172.16.2.8'
$INDEX = $INDEX +1

AddPrinterConnection("\\172.16.2.8\KONICAMI_500")
AT (12 + $INDEX,3) 'CONECTANDO IMPREOSRA KONIKA 500 EN 172.16.2.8'
$INDEX = $INDEX +1

DelPrinterConnection("\\scerritos1\KONICAMI_470")
AT (12 + $INDEX,3) 'BORRANDO IMPREOSRA KONIKA 470 EN SCERRITOS1'
$INDEX = $INDEX +1

AddPrinterConnection("\\scerritos1\KONICAMI_470")
AT (12 + $INDEX,3) 'CONECTANDO IMPRESORA KONIKA 470 EN SCERRITOS1'
$INDEX = $INDEX +1

DelPrinterConnection("\\172.16.2.8\KONICAMI_470")
AT (12 + $INDEX,3) 'BORRANDO IMPREOSRA KONIKA 470 EN 172.16.2.8'
$INDEX = $INDEX +1
AddPrinterConnection("\\172.16.2.8\KONICAMI_470")
AT (12 + $INDEX,3) 'CONECTANDO IMPRESORA KONIKA 470 EN 172.16.2.8'
$INDEX = $INDEX +1
DelPrinterConnection("\\172.16.2.8\DellColo")
AT (12 + $INDEX,3) 'BORRANDO IMPREOSRA DellColo EN 172.16.2.8'
$INDEX = $INDEX +1
DelPrinterConnection("\\scerritos1\DellColo")
AT (12 + $INDEX,3) 'BORRANDO IMPREOSRA DELL COLOR EN SCERRITOS1'
$INDEX = $INDEX +1
DelPrinterConnection("\\172.16.2.8\KONICAMI_250")
AT (12 + $INDEX,3) 'BORRANDO IMPREOSRA KONIKA 250 EN 172.16.2.8'
$INDEX = $INDEX +1
DelPrinterConnection("\\172.16.2.8\KONICAMI_250")
AT (12 + $INDEX,3) 'BORRANDO IMPREOSRA KONIKA 250 EN SCERRITOS1'
$INDEX = $INDEX +1

;AddPrinterConnection("\\scerritos1\KONICAMI_500")
;AddPrinterConnection("\\172.16.2.8\KONICAMI_500")
;AT (12 + $INDEX,3) 'CONECTANDO IMPREOSRA KONIKA 500'
;$INDEX = $INDEX +1
;AddPrinterConnection("\\scerritos1\KONICAMI_470")
;AddPrinterConnection("\\172.16.2.8\KONICAMI_470")
;AT (12 + $INDEX,3) 'CONECTANDO IMPRESORA KONIKA 470'
;$INDEX = $INDEX +1

IF INGROUP = "TI" AND INGROUP = "VICEPRESIDENCIAS Y PRESIDENCIA"
AT (12 + $INDEX,3) 'CONECTANDO IMPRESORA DELL COLOR'
$INDEX = $INDEX +1
AddPrinterConnection("\\scerritos1\DellColo")
AddPrinterConnection("\\172.16.2.8\DellColo")
ENDIF
IF INGROUP = "COMPRAS" AND INGROUP = "ALMACEN"
AT (12 + $INDEX,3) 'CONECTANDO IMPRESORA KONIKA 250'
$INDEX = $INDEX +1
AddPrinterConnection("\\scerritos1\KONICAMI_250")
AddPrinterConnection("\\172.16.2.8\KONICAMI_250")
ENDIF
ENDFUNCTION
;FUNTIONS
;-----------------------------------------------------------------
;Programa principal(MAIN)
;-----------------------------------------------------------------
;AT (12 + $INDEX,3) '********** BORRADO DE ARCHIVOS DE KIXTART *************'
;$INDEX = $INDEX +1
;DEL_KIXFILES_FOLDER()
;AT (12 + $INDEX,3) '*********** COPIADO DE ARCHIVOS DE KIXTART ************'
;$INDEX = $INDEX +1
;COPY_KIXFILES_FOLDER()
;AT (12 + $INDEX,3) '************ CARGA DE UNIDADES DE RED ***********'
;$INDEX = $INDEX +1
;INIT_UNIT ()
;AT (12 + $INDEX,3) '************ MENSAJE DEL DIA ***********'
;$INDEX = $INDEX +1
;MNSJ_DIA()
;AT (12 + $INDEX,3) '************ BLOQUEO DE USB Y CD ***********'
;$INDEX = $INDEX +1
;CD_USB()
;AT (12 + $INDEX,3) '************* FONDO DE ESCRITORIO NAVIDAD **********'
;$INDEX = $INDEX +1
;FONDO_ESCRT_NAV()
AT (12 + $INDEX,3) '************* IMPRESORAS DE RED **********'
$INDEX = $INDEX +1
IMPRESORAS_RED ()
;AT (12 + $INDEX,3) '************ FONDO DE ESCRITORIO ***********'
;$INDEX = $INDEX +1
;CHG_WLLPPR()
;AT (12 + $INDEX,3) '************ BORRADO DE UNIDADES DE RED ***********'
;$INDEX = $INDEX +1
;DEL_UNIT () "solo para usar en caso de que se presenten problemas con las unidades de red en algún equipo"
SLEEP (30)
:End

after i compile the script and run it, it appears the next error and i don't know what it means as the error line, doesn't appear in the code.
The error is:
ERROR: invalid method/function call: missin '('!
Script: C:\Temp\k2e~184877\stftijhd.tmp
Line: 189

Can anyone help me, thanks.

Top
#201484 - 2011-02-02 01:10 AM Re: hello, i have a problem with the next script that i made to mapping printer [Re: jaime]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
It may be that last sleep line. Should be...

 Code:
SLEEP 30

Top
#201487 - 2011-02-02 10:29 PM Re: hello, i have a problem with the next script that i made to mapping printer [Re: ShaneEP]
jaime Offline
Fresh Scripter

Registered: 2010-10-04
Posts: 5
Loc: Colombia
thanks, but itsn't the sleep
Top
#201490 - 2011-02-03 10:35 AM Re: hello, i have a problem with the next script that i made to mapping printer [Re: jaime]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Hola Jaime,

your problem are the INGROUP calls:

Change all occurances of eg. INGROUP = "TI" to INGROUP("TI")
INGROUP is a function, not a constant..
_________________________



Top
#201505 - 2011-02-07 04:40 PM Re: hello, i have a problem with the next script that i made to mapping printer [Re: Jochen]
jaime Offline
Fresh Scripter

Registered: 2010-10-04
Posts: 5
Loc: Colombia
Thanks, it helps a lot.
It were the error.

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

Generated in 0.056 seconds in which 0.026 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