#42198 - 2003-06-27 08:51 PM
New to batch scripting, please help.
|
JRe
Fresh Scripter
Registered: 2003-06-27
Posts: 11
Loc: USA
|
Hello, I've been searching around the site trying to find examples of a script to map shared printers to multiple workstations. The primary server is NT4sp6a (where Kix32 is running), the print server is 2000sp3(server), as are the workstations(WS). I can't seem to get addprinterconnection("\\server\printername") to work properly. I've tried a few different parameters, but I get an error on the workstation I'm testing on (but the error is so fast i can't read it). I tried putting the ? 'Error - etc. syntax, but it won't work either. I'm pretty new to this, so any help would be most appreciated. Thanks, Joe
|
Top
|
|
|
|
#42201 - 2003-06-27 09:06 PM
Re: New to batch scripting, please help.
|
JRe
Fresh Scripter
Registered: 2003-06-27
Posts: 11
Loc: USA
|
The first code I tried was:
if addprinterconnection("\\servername\printername") = 0 ? "Added Printer Connection..." endif
And a few vaiation of the above. Thanks
|
Top
|
|
|
|
#42203 - 2003-06-27 09:19 PM
Re: New to batch scripting, please help.
|
JRe
Fresh Scripter
Registered: 2003-06-27
Posts: 11
Loc: USA
|
Parameters was the wrong choice of words (I tried w/out = 0, :start/:end, break on, etc), and yes, I did try the code but the console just flashes. I can see that it says error, I can't get specifics. Let me just be sure I have Kix32 installed correctly: Kix32.exe in the root of C: on the NT PDC. Kixtart.kix file in the root of C: as well (this is the file I created with the code). User profile set to use Kix32 as logon script. What am I doing wrong? Thanks, jr
|
Top
|
|
|
|
#42205 - 2003-06-27 09:50 PM
Re: New to batch scripting, please help.
|
JRe
Fresh Scripter
Registered: 2003-06-27
Posts: 11
Loc: USA
|
Ok, so kix32 is the old version. I thought I was using the version 4, but I guess not. When you say \sharename, that's the shared printer name, correct? That's what I meant when I said \printername. Is there a difference? I have not yet run the script directly from the console of the NT PDC, only from logging in on the client test workstation. What is the correct syntax for testing directly from the shell on the NT server (c:>kix32 kixtart.kix etc...)? Thanks, jr
|
Top
|
|
|
|
#42208 - 2003-06-27 09:57 PM
Re: New to batch scripting, please help.
|
JRe
Fresh Scripter
Registered: 2003-06-27
Posts: 11
Loc: USA
|
Ok, I ran it from the console (c:>kix32) and I got the error 1797 printer driver unknown. Of course, this is an NT 4 machine and the print server is 2000 as are all the print drivers. Is there a way to resolve this? thanks, jr
|
Top
|
|
|
|
#42210 - 2003-06-27 10:02 PM
Re: New to batch scripting, please help.
|
JRe
Fresh Scripter
Registered: 2003-06-27
Posts: 11
Loc: USA
|
So if the shared printer is named/shared as printer1 and it's on a server called server1, the code should be addprinterconnection("\\server1\printer1"), correct? This is how I have it set up. Is there any preceding code, such as start or clear or function()? Thanks
|
Top
|
|
|
|
#42211 - 2003-06-27 10:10 PM
Re: New to batch scripting, please help.
|
JRe
Fresh Scripter
Registered: 2003-06-27
Posts: 11
Loc: USA
|
Attempted to install additional drivers on the 2000 print server, but when I insert the NT 4 server disc, as prompted, it returns an error and does not load. I'm going to try the 2000 sever cd, but I don't think that will work either. I can't run kix32 from the 2000 server because it's not a DC. jr
|
Top
|
|
|
|
#42213 - 2003-06-27 10:24 PM
Re: New to batch scripting, please help.
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Don't the scripts run from %LOGONSERVER%\NETLOGON share of the DC server?
Your clients (unless they are all Domain Admins) will not be able to start \\DCSERVER\C$\KIX32..
Kent
|
Top
|
|
|
|
#42215 - 2003-06-27 10:27 PM
Re: New to batch scripting, please help.
|
JRe
Fresh Scripter
Registered: 2003-06-27
Posts: 11
Loc: USA
|
Ok, so I got the additional NT driver loaded on the 2K server. It was a file called Badnt4.inf, in D:\PRINTERS\FIXPRNSV\NT4. I then ran the kix32 from the console and it worked perfectly, loading the printer onto the NT server. So then I tried to run it as a login on the test 2K machine, but it still fails. What the...? Do I need to write to the reg of the 2k workstation, or something like this? jr
|
Top
|
|
|
|
#42216 - 2003-06-27 10:32 PM
Re: New to batch scripting, please help.
|
JRe
Fresh Scripter
Registered: 2003-06-27
Posts: 11
Loc: USA
|
You are quite right, and I'm sure this is the problem, but, do I have to create a share called NETLOGON with Domain User access, because one does not exist. KIX32 is running from the root of the DC. This has to be the issue. And if I create this share, do I have to specify the path to net logon in the user profile, or will kix32 lok there by default? Thanks, jr
quote: Don't the scripts run from %LOGONSERVER%\NETLOGON share of the DC server?
Your clients (unless they are all Domain Admins) will not be able to start \\DCSERVER\C$\KIX32..
Kent
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 229 anonymous users online.
|
|
|