#22913 - 2002-06-11 07:05 PM
Default Printers and Deleting help needed
|
Jhawk
Fresh Scripter
Registered: 2002-06-11
Posts: 12
Loc: KS
|
Hey all.. new to the board, I just picked up Kixtart and I'm having a couple of simple (I imagine) problems.
First off,
I cannot seem to get my Kixtart (V4.02) to set a Default Printer.
Here are the lines I'm using..
If AddPrinterConnection ("\\hercules\4050") = 0 ? "Added printer connection...." sleep 1 If SetDefaultPrinter ("\\hercules\4050") = 0 ? "Set default printer to HP LaserJet 4...." sleep 1 Endif Endif
I'm doing the sleeping just so I can read the added printer connection message, I never get the set default printer message and it doesn't seem to work either. All Win2K network.
Also, I can't find a simple way to delete all connections. Do I have to list every printer on my network in statements to delete them all? That would take quite a bit; I'm sure there must be a command for deleting everything.
Pre-Thanks to any help I get!
|
|
Top
|
|
|
|
#22916 - 2002-06-11 07:37 PM
Re: Default Printers and Deleting help needed
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
|
|
Top
|
|
|
|
#22917 - 2002-06-11 08:23 PM
Re: Default Printers and Deleting help needed
|
Jhawk
Fresh Scripter
Registered: 2002-06-11
Posts: 12
Loc: KS
|
Sealeopard,
I put the error statements in..
It came back with 2- The system cannot find the file specified.
I get the added printer connection first, then that error. I'm not sure why it's giving me trouble.
The delprinterconnection ("") does work. Thanks!
|
|
Top
|
|
|
|
#22919 - 2002-06-11 08:51 PM
Re: Default Printers and Deleting help needed
|
Jhawk
Fresh Scripter
Registered: 2002-06-11
Posts: 12
Loc: KS
|
I'm actually just trying to get this to run on my PC right now. I am administrator of the PC itself as well as my network account having Domain Administrator privileges.
I tried to steal someone else's script and plug my own server/share names in to see if perhaps I was mistyping something, but I couldn't get there's to set the default printer either. Perhaps there is some kind of problem with V4.02 and Win2k? Is anyone using Win2000?
I see there is a new version 4.10, but I didn't choose it due to the fact that it is in beta. Maybe I should give it a try.
|
|
Top
|
|
|
|
#22921 - 2002-06-11 09:26 PM
Re: Default Printers and Deleting help needed
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
I'm running 4.02 on win2k (nt4 network)
it works fine for me (I'm using the udf)
|
|
Top
|
|
|
|
#22923 - 2002-06-11 10:28 PM
Re: Default Printers and Deleting help needed
|
Jhawk
Fresh Scripter
Registered: 2002-06-11
Posts: 12
Loc: KS
|
Yes, I can manually add the printer.. through control panel- printers. It's really strange.. I can delete all of the printers and then add the printer I want as default first (defaulting it to default), but I would rather have it work correctly.
BTW we are all win2k and 2000 server
|
|
Top
|
|
|
|
#22926 - 2002-06-12 03:38 PM
Re: Default Printers and Deleting help needed
|
Jhawk
Fresh Scripter
Registered: 2002-06-11
Posts: 12
Loc: KS
|
Hmm, I checked all of my Printer share names and I seem to be using the correct shares. I've tried quite a few different printers.
Schuliebug,
I'm basically using the same format as Radius. I made a couple small changes, and I don't know what the $rc variable is.
Also, one of our consultants was nice enough to allow me to borrow a kixtart script that another client was using. I changed a couple of the Printer names to my companies server/shares and it is not mapping the default printer either.
Below is a copy of the scripting..
At (10,20) @fullname At (12,20) "Please Wait For Logon Script Execution" At (26,20) " " At (28,20) "Mapping your Common Directory and Printers" sleep 2
If ADDPRINTERCONNECTION ("\\hercules\4050") = 0 ? "Added printer connection to \\hercules\4050" Endif
;If ADDPRINTERCONNECTION ("\\pdc01\pb_acctserv_tst") = 0 ;? "Added printer connection to \\pdc01\pb_acctserv_tst" ;Endif
;If ADDPRINTERCONNECTION ("\\pdc01\pb_shipping_tst") = 0 ;? "Added printer connection to \\pdc01\pb_shipping_tst" ;Endif
;If ADDPRINTERCONNECTION ("\\pdc01\pb_shiptwo_tst") = 0 ;? "Added printer connection to \\pdc01\pb_shiptwo_tst" ;Endif
If ADDPRINTERCONNECTION ("\\backup\accounting") = 0 ? "Added printer connection to \\backup\accounting" Endif
If SetDefaultPrinter ("\\backup\accounting") = 0 ? "Set default printer to Accounting...." Endif
Return
I modified this to add //backup/accounting, and //hercules/4050 which are both my printers. The rest of the lines I REM'd.. those we're the pre-existing printers from the other company.
|
|
Top
|
|
|
|
#22928 - 2002-06-12 03:56 PM
Re: Default Printers and Deleting help needed
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
use the UDF... even for testing purposes. Then verify the printer is connected delete the printer and map it again with the UDF
If that works, then it is your code.
If it doesn't, then it could be the rest of your code, permissions to the machine or the printer, printer drivers available on the server, etc.
|
|
Top
|
|
|
|
#22929 - 2002-06-12 04:03 PM
Re: Default Printers and Deleting help needed
|
Jhawk
Fresh Scripter
Registered: 2002-06-11
Posts: 12
Loc: KS
|
Lonkero,
You are the *man*!! Calling by the printer name as opposed to the share works!
At least it did this time! I will try to produce my whole script or at least a much larger version (i'm using ingroup to seperate departments)
It seems like the case may be solved, thanks to all for the help!
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 484 anonymous users online.
|
|
|