I am getting error code 2 - system cannot find the specified file specified.
I read a lot in forums that i must use printername and not share name. Hence i changed my printername and sharename to be the same.
I am going crazy with setting printer as default. What is wrong in this code ?
Code :- ------- IF INGROUP("DA Omgevingen") DELPRINTERCONNECTION ("\\terminal-deakke\Bro-HL1440") ADDPRINTERCONNECTION ("\\terminal-deakke\Bro-HL1440") SETDEFAULTPRINTER ("\\terminal-deakke\Bro-HL1440") ? "This is error"+@Error+"-"+@SError ENDIF
Is this related to 15 character computer name limitation of windows. My servername comes to 16 chars. But for networksharing i am using only 15chars and that works.
Yes, net view \\terminal-deakke returns this: Sharename Type --------- ---- Bro-HL1440 Print
This is error 1801 - The printer name is invalid 123ncorrect.rror 123 - The filename,directoryname, or the volumelabel syntax is invalid 2This is error 2 - The system cannot find the file specified.
#159055 - 2006-03-1411:40 PMRe: Another SETDEFAULTPRINTER problem
NTDOCNTDOC Administrator
Registered: 2000-07-28
Posts: 11634
Loc: Space
Well I think you need to first resolve the first error which is probably why you're getting the other 2 errors.
Take it one step at a time.
Can you manually install the printer this way?
Click on Start, Run, then type in \\terminal-deakke and hit the Enter key. That should put you on that server. Then right click on Bro-HL1440 and choose connect.
#159057 - 2006-03-1411:57 PMRe: Another SETDEFAULTPRINTER problem
NTDOCNTDOC Administrator
Registered: 2000-07-28
Posts: 11634
Loc: Space
IF you can manually add the printer as I've shown without any issue, then please try this code again and post the results.
Run this as the ONLY script, do not add it to any other portion of a script. Also, please let us know what version of KiXtart you're using and the OS version of the Server this printer is being shared on.
The printer is physically connected to a printserver. It is installed on a terminal-server so that it can be made available for the users in their terminal session.
I just made a new printer with BROHL1440 and same sharename, ended up with same error. Printer name seems to be not the problem. But the error strangely say's 1801 "Invalid printer name".
I can see the shared printer on the server when i run \\terminal-deakke. I belive i should be able to connect also if the computers are logged on to the domain. But we are using remotedesktop tool to connect the terminal-server.
#159060 - 2006-03-1512:45 AMRe: Another SETDEFAULTPRINTER problem
NTDOCNTDOC Administrator
Registered: 2000-07-28
Posts: 11634
Loc: Space
Well it could be the @Domain portion of the code, but that's okay you can remove that portion and put that line back to:
If InGroup('DA Omgevingen')
But the issue appears to be something in / on your network and / or how you're sharing this printer.
You need to get it resolved to a point that you can normally add a printer. If you can't add the printer manually then KiXtart won't be able to either.
#159061 - 2006-03-1501:11 AMRe: Another SETDEFAULTPRINTER problem
NTDOCNTDOC Administrator
Registered: 2000-07-28
Posts: 11634
Loc: Space
Quote: I can see the shared printer on the server when i run \\terminal-deakke. I belive i should be able to connect also if the computers are logged on to the domain. But we are using remotedesktop tool to connect the terminal-server.
But you don't say if you can connect that way or not. So, can you connect or do you get an error?
i tried If InGroup('DA Omgevingen') in place of @Domain. No error or nothing appeared on screen. Printer not set to be default.
On my Dataserver i ran \\terminal-deakke and connected the printer successfully. What can be the network problem if i can succesfully connect the printer. Very strange i am getting printer name is invalid error.
I Shared the printer this way. New printer - Right clik printer -properties -sharename - list in activedirectory is ticked.
I removed the addprinter entry and saw that the printer is still avaliable in the terminal seessions. So i removed the delprinter and addprinter entries and added the below. SetDefaultPrinter("Bro-HL1440"). I checked with few of the users and it seems that Bro-HL1440 is now the default printer.
Thanks NTDOC and Lonkero very much for you help and assistance.