sc is a command program. The file is sc.exe and is in the Windows 2000
Resource Kit. It executes service related functions on the local or remote
computer.
In this case, I've used it to stop and start the spooler service. You can
also do this with the Computer Management mmc or the net stop / net start
command. You can use the Computer Management tool remotely, but not the
"net" command.
I suggest you clean all of the "printers" and printer drivers of the Windows
XP client you are testing this with before doing any more testing. See
http://members.shaw.ca/bsanders/CleanPrinterDrivers.htm for how to do this.
If you are getting "print subsystem is unavailable" then either:
1. the computer you are targetting (remotely) is not running the OS (e.g.
powered off) or otherwise can not be communicating with over the network
(e.g. you have XP's ICF enabled and this is blocking the remote execution of
the request to add the printer)
or
2. the print spooler service is not running on the target computer.
To see the "Version" of print drivers:
a. open the Printers (or Printers and Faxes) folder
b. click File, Server Properties
c. select the Drivers tab
If the "Version" column says "NT 4 or 2000", that driver is Version 2. If
the it says "Windows 2000" or "Windows 2000 or XP", that driver is "Version
3". To get this information remotely (e.g. from a Windows XP client get the
information from the Windows 2000 server):
1. logon at the Windows XP computer with a user account that is an
administrator on the Windows 2000 server
2. click Start, Run
3. key \\ followed by the name of the Windows 2000 server (e.g. \\S1) and
press Enter (or click OK). This will open a Windows Explorer window and one
of the items in the right pane will be "Printers and Faxes".
4. double click on the "Printers and Faxes" in the right pane
5. you will now see all of the printers on the Windows 2000 server
6. click File, Server Properties
7. select the Drivers tab
If you do this, the "Version" column will show "Windows 2000 or XP" if the
driver on the Windows 2000 Server is of the Version 3 variety.
If you do not have any Windows NT 4 computers, then I suggest you ensure you
are using the "Version 3" driver variety, which you can get from
http://welcome.hp.com/country/us/en/support.html. The file name for the HP
LaserJet 4000 is lj4000pcl6win2kxp2003-en.exe (you get the same file if you
select Windows 2000, Windows XP or Windows 2003 on the HP download pages).
This driver will work on Windows 2000, Window XP and Windows 2003. I
suggest making sure that whatever driver is on the Windows 2000 server be
removed (see
http://members.shaw.ca/bsanders/CleanPrinterDrivers.htm) before
installing the new driver.
It is not clear from which computer you are issuing the "rundll32
printui.dll,PrintUIEntry /ga ... " command. If you are doing this while
logged on at the client computer, then leave out the "/c\\..." part.
If you are running the command from one computer to add the printer to
another computer, the /c\\ part must have the name of the target computer.
So, if the computer name of the target is computer1, then this parameter
would be /c\\computer1. You can add a network printer to another computer
while logged on at either the Windows 2000 server or while logged on at a
Windows XP workstation as long as you use a user account that is an
administrator on the target computer.
Since you are having a problem, might I suggest that you try doing the
operation while logged on locally at the Windows XP computer you want to add
the printer to as an administrator. If the "share name" of the printer you
want to add for all the users is "P1" and the Windows 2000 server computer
name is "S1", the command to issue on the Windows XP computer would be:
rundll32 printui.dll,PrintUIEntry /ga /n\\S1\p1
After issuing the command above, use the commands below, or do the same
thing using Computer Managment or Services from the Administrative Tools
folder
net stop spooler
net start spooler
Then, open the Printers and Faxes folder. You should see the just added
printer. If it is not, click View Refresh. The Status may not become
"Ready" for a while because the driver will have to be copied from the print
server and installed first.
Then, logoff and logon again as a normal user and open the Printers and
Faxes folder. The just added printer should appear, but it may take a few
seconds to show up.
Since keying all of this correctly (PrintUIEntry must be in the correct
case) is a pain, I usually put it into a command file. You can make the
command file generic with appropriate parameters (e.g. %1), as per my web
site, or key the whole command exactly for adding a specific printer to a
specific computer. Since the "net" command does not allow you to target
another computer, I've used the sc command instead to remotely stop and
start the print spooler.
This stuff does work - we've used it to deploy 10-15 network printers on
each of about 500 Windows XP workstations, many of them in a different
location (hundreds of miles away). Some of the printers are HP LaserJet
4000s. If you are still having a problem, then perhaps it would help if you
could document exactly what steps you are taking on what computer and
exactly when you get the symptom.