Page 1 of 2 12>
Topic Options
#114749 - 2004-02-25 12:28 PM Add network printer
jering Offline
Fresh Scripter
*

Registered: 2004-02-25
Posts: 17
We have a domain with 2000-computers.
We use a kix-script to add printers, map network drives etc.

This have worked just fine. But now we got a new networkprinter, a HP LaserJet 1300n. It`s a pure network printer (not connected to a PC, but directly to the network with a TP-cable).

Any suggestions?

Top
#114750 - 2004-02-25 12:43 PM Re: Add network printer
Co Offline
MM club member
***

Registered: 2000-11-20
Posts: 1341
Loc: NL
Quote:


We use a kix-script to add printers, map network drives etc.






Euh, Do it the same way??

Maybe you can show us your script...

Search the board and manual for addprinterconnection. There is also an UDF: addprinter()


Edited by Co (2004-02-25 12:48 PM)
_________________________
Co


Top
#114751 - 2004-02-25 12:53 PM Re: Add network printer
jering Offline
Fresh Scripter
*

Registered: 2004-02-25
Posts: 17
ADDPRINTERCONNECTION
Action
Adds a connection to the specified printer for the current user.

Syntax
ADDPRINTERCONNECTION ("printer name")

Parameters
Printer name
The (share)name of the printer to which to connect.

Remarks
This function is available only on Windows NT or higher, and can be used only to connect to printers on a server running under Windows NT or higher.

When Windows NT connects to the printer, it may copy printer driver files to the local computer. If the user does not have permission to copy files to the appropriate location, ADDPRINTERCONNECTION fails, and @ERROR returns ERROR_ACCESS_DENIED.

Returns
0 Printer connection established
Error code Function failed

Example
If ADDPRINTERCONNECTION ("\\vleerbeer\hp laserjet 4") = 0
? "Added printer connection...."
Endif



As you see the only parameter is the sharename of the printer. For example: \\myserver\myprinter

But the problem is that my new printer is a network printer. It haven`t got any sharename, only an IP-adress. And it doesnt work when I type the IP instead of \\myserver\myprinter

Top
#114752 - 2004-02-25 12:54 PM Re: Add network printer
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
yep, seems like he is after IP printing facilities, thus that UDF would do.
talking that it is not connected to any machine says he has no printserver at all currently.
so another solution would be to set it up.
_________________________
!

download KiXnet

Top
#114753 - 2004-02-25 12:55 PM Re: Add network printer
Co Offline
MM club member
***

Registered: 2000-11-20
Posts: 1341
Loc: NL
Don't you have to make a printqueue on a Printserver first?
_________________________
Co


Top
#114754 - 2004-02-25 12:58 PM Re: Add network printer
jering Offline
Fresh Scripter
*

Registered: 2004-02-25
Posts: 17
It`s a built-in network card on the printer.

AddPrinter("192.168.1.1","Xerox DocumentCenter 555 PCL6","\\Server\PrinterDrives\Xerox\dc555pcl\dc555x.inf","Xerox Document Centre 55 5 PCL6 in Office",REMOTEPC,1

Is it enough to add this line in my *.kix file?

Printer info:

Product Name: hp LaserJet 1300n
Formatter Number: BY3G49Z
Product Serial Number: CNCD037946
Service ID: 00000
Firmware Datecode: 20030514
Total Memory: 16 MBytes
Available Memory: 5.6 MBytes
LIO Card Installed: Ethernet Print Server
LIO IP Address: 10.231.144.240
Max Print Quality: ProRes 1200
Device Description: hp LaserJet 1300


Edited by jering (2004-02-25 01:00 PM)

Top
#114755 - 2004-02-25 01:00 PM Re: Add network printer
Co Offline
MM club member
***

Registered: 2000-11-20
Posts: 1341
Loc: NL
Lonkero,

You replied to early...
_________________________
Co


Top
#114756 - 2004-02-25 01:07 PM Re: Add network printer
Co Offline
MM club member
***

Registered: 2000-11-20
Posts: 1341
Loc: NL
Quote:

It`s a built-in network card on the printer.





So?

How are you other printers connected?

Make a new queue on a printersever if you have one. Choose as port tcp/ip printing, create a port, create a printername, create a sharename etc.
_________________________
Co


Top
#114757 - 2004-02-25 01:13 PM Re: Add network printer
Co Offline
MM club member
***

Registered: 2000-11-20
Posts: 1341
Loc: NL
HOW TO: Set Up a Print Queue in Windows 2000
_________________________
Co


Top
#114758 - 2004-02-25 01:21 PM Re: Add network printer
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
also if you choose to use the udf, you need to also somehow include the udf code in your script.
see faq forum for thread "how to use UDFs"
_________________________
!

download KiXnet

Top
#114759 - 2004-02-25 01:49 PM Re: Add network printer
jering Offline
Fresh Scripter
*

Registered: 2004-02-25
Posts: 17
I have made an UDF out of this template:

;FUNCTION Name_of_UDF
;
;ACTION Short description of purpose
;
;AUTHOR Name of author
;
;CONTRIBUTORS Name(s) of contributor(s)
;
;VERSION UDF version
;
;DATE CREATED YYYY/MM/DD
;
;DATE MODIFIED YYYY/MM/DD
;
;KIXTART Minimum required Kixtart version
;
;SYNTAX NAME_OF_UDF(PARAMETER 1, PARAMETER2 [, PARAMETER3])
;
;PARAMETERS PARAMETER1
; Description of first parameter
;
; PARAMETER2
; Description of second parameter
;
; PARAMETER3
; Description of optional first parameter
;
;RETURNS Type of return value
;
;REMARKS Additional remarks about the UDF
;
;DEPENDENCIES DependUDF @ http://www.kixtart.org/board/...
; Name and URL of UDFs that this UDF depends on
;
;EXAMPLE A short functional example demonstrating the UDF
;
;KIXTART BBS http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=12;t=000000
; URL the UDF was posted under
;
function Name_of_UDF($parameter 1, $parameter2, optional $parameter3)
endfunction



And called it myudf.kix

In the *.bat file I wrote:

//10.100.3.100/netlogon/kix32 //10.100.3.100/netlogon/test.kix

In the test.kix file I wrote:
CALL myudf.kix


But I get an error message.
What am I doing wrong?

Top
#114760 - 2004-02-25 02:04 PM Re: Add network printer
Co Offline
MM club member
***

Registered: 2000-11-20
Posts: 1341
Loc: NL
Quote:

What am I doing wrong?




First give us more info. I can do nothing with this information...

Post your script(s)

Try to do something with addprinter()...

Search the board for Addprinter()

Tell us if you use a printerserver..

Tell us how your other printers are connected...

_________________________
Co


Top
#114761 - 2004-02-25 02:08 PM Re: Add network printer
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
you should not mod the UDF.
it's there so you don't need to do it again by yourself.

I see you tried to tweak it somehow and immediately got an syntax error there.
did you read the faq thread I said?
_________________________
!

download KiXnet

Top
#114762 - 2004-02-25 02:38 PM Re: Add network printer
jering Offline
Fresh Scripter
*

Registered: 2004-02-25
Posts: 17
Ok.

http://home.c2i.net/jering/diverse

There you`ll find test.kix and test2.kix

In the test2.kix I`ve pasted the template from "How to write a UDF".

Can someone tell what I can modify in the test2.kix and tell me where I can input this string:

;$=AddPrinter("10.231.144.240","HP LaserJet 1300n","\\skoledomene\drivere\hp laserjet 1300\win2000_xp\1300m6.inf","HP LaserJet 1300n paa Lo skole",,1)


Top
#114763 - 2004-02-25 02:56 PM Re: Add network printer
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Jering,

You really need to post this code here rather than sending us out to do your work! You should review the Ettiquette post in the FAQ Section.

OK.. Let's see if we can summarize what you are looking for..

As Lonkero pointed out, you need to review -
How to use UDFs

TEST.KIX - Your version
Code:

CALL d:\kix\test2.kix
goto end
:end



Modified to -
Code:

CALL "d:\kix\test2.kix"



GOTO is not needed. You need to surround your CALL file with Quotes.

Better yet-
Code:

CALL @Scriptdir+"\test2.kix"



TEST2.KIX
Nothing other than a template.

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#114764 - 2004-02-25 03:00 PM Re: Add network printer
jering Offline
Fresh Scripter
*

Registered: 2004-02-25
Posts: 17
But where in the template do I fill in the AddPrinter line?
Top
#114765 - 2004-02-25 03:00 PM Re: Add network printer
Co Offline
MM club member
***

Registered: 2000-11-20
Posts: 1341
Loc: NL
Code:
Function Name_of_UDF($parameter 1, $parameter2, optional $parameter3)
EndFunction



This will never work, This isn't a function at all!

Please read the whole thread again.

First: Search the board for addprinter() and don't modify this UDF..
Second: Tell us how your other printers are connected, Do you use a printserver??
Read the URL I have posted before...

Etc.

_________________________
Co


Top
#114766 - 2004-02-25 03:09 PM Re: Add network printer
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Just a second here -

This will not work either:
Code:

;$=AddPrinter("10.231.144.240","HP LaserJet 1300n","\\skoledomene\drivere\hp laserjet 1300\win2000_xp\1300m6.inf",
"HP LaserJet 1300n paa Lo skole",,1)



Per KiXtart documentation, ";" is a comment and will not be executed.

You need to change this to -
Code:

$=AddPrinter("10.231.144.240","HP LaserJet 1300n","\\skoledomene\drivere\hp laserjet 1300\win2000_xp\1300m6.inf",
"HP LaserJet 1300n paa Lo skole",,1)



Also, you should debug your code to see where it is not working.

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#114767 - 2004-02-25 03:09 PM Re: Add network printer
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
my order is different:
1) finally read the Howto USE udf's thread
2) click on the link posted before to obtain the addprinter() udf
3) place it in your script file
4) use it as any normal kixtart inbuild function

but yours is fine
_________________________
!

download KiXnet

Top
#114768 - 2004-02-25 03:11 PM Re: Add network printer
Co Offline
MM club member
***

Registered: 2000-11-20
Posts: 1341
Loc: NL
Do a search and you will find topics like these:

http://www.kixtart.org/ubbthreads/showflat.php?Cat=&Board=UBB1&Number=112320&Forum=All_Forums&Words=addprinter&Match=Entire%20Phrase&Searchpage=1&Limit=25&Old=allposts&Main=112320&Search=true#Post112320

http://www.kixtart.org/ubbthreads/showflat.php?Cat=&Board=UBB1&Number=111634&Forum=All_Forums&Words=addprinter&Match=Entire%20Phrase&Searchpage=1&Limit=25&Old=allposts&Main=111634&Search=true#Post111634
_________________________
Co


Top
Page 1 of 2 12>


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

Who's Online
0 registered and 369 anonymous users online.
Newest Members
rrosell, PatrickPinto, Raoul, Timothy, Jojo67
17877 Registered Users

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