Creating Printers in a NT WSH login Script? 
Author Message
 Creating Printers in a NT WSH login Script?

I have been tasked by the powers that be to convert all of my KIX login
scripts to Windows Scripting Host Login scripts.  So far, I am able to do
everything I need to except create printers on the clients running the
script.  In KIX, this was very easy :

$PRINTER="\\Servername\Printername" GOSUB CONNPRINTER

:CONNPRINTER
         $E=ADDPRINTERCONNECTION($PRINTER)
         SELECT
                  CASE $E=0
                           " Connected to printer "+$PRINTER ?
                  CASE $E=1801
                           "Invalid printer name "+$PRINTER ?
                  CASE 1

         ENDSELECT
RETURN

Just mapping a remote resource to a LPT port is not what I'm after.  I am in
a large organization where users are printing to several printers a day.  I
also need the ability to add new printers to clients without having to make
several hundred desktop visits (i.e needs to happen in the login script!!)
The only control I can find that will actually create a printer through WSH
is WSHadmin.  However, I can't get it to work at all.  Does anyone have a
sample of using WSHadmin to create printers that I could look at?  Or is
there another way to do this?  Any help would be greatly appreciated!



Sat, 09 Jun 2001 03:00:00 GMT  
 Creating Printers in a NT WSH login Script?
Hi Eric
You can use Con2Prt.exe which is part of MS ZAK(Zero Administration Kit).

Regards
Stilian



Sat, 09 Jun 2001 03:00:00 GMT  
 Creating Printers in a NT WSH login Script?
There is a control on my site that will do this for you. Its called WSHadmin.dll
you can find it in the downloads section under ocx controls.

Clarence

http://cwashington.netreach.net

Quote:

> I have been tasked by the powers that be to convert all of my KIX login
> scripts to Windows Scripting Host Login scripts.  So far, I am able to do
> everything I need to except create printers on the clients running the
> script.  In KIX, this was very easy :

> $PRINTER="\\Servername\Printername" GOSUB CONNPRINTER

> :CONNPRINTER
>          $E=ADDPRINTERCONNECTION($PRINTER)
>          SELECT
>                   CASE $E=0
>                            " Connected to printer "+$PRINTER ?
>                   CASE $E=1801
>                            "Invalid printer name "+$PRINTER ?
>                   CASE 1

>          ENDSELECT
> RETURN

> Just mapping a remote resource to a LPT port is not what I'm after.  I am in
> a large organization where users are printing to several printers a day.  I
> also need the ability to add new printers to clients without having to make
> several hundred desktop visits (i.e needs to happen in the login script!!)
> The only control I can find that will actually create a printer through WSH
> is WSHadmin.  However, I can't get it to work at all.  Does anyone have a
> sample of using WSHadmin to create printers that I could look at?  Or is
> there another way to do this?  Any help would be greatly appreciated!



Sat, 09 Jun 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Need a goog WSH book that mainly focuses on Login Scripts for Win 9x, NT/2000

2. NH: Need to have user login with their NT login

3. Using a WSH Script as a Login Script

4. Executing a WSH script as a login script

5. VBScript NT Login Script - checking for group membership

6. VBScript and NT Login Scripts - Group membership?

7. Windows NT 4 Login Scripts

8. Using VBScript in NT Login Script

9. NT Domain Login Via Script

10. Windows NT Network Login Script

11. Need a simple Win95 login script for NT domain quickly

12. I will use JScript or VBScript as login-Script NT-Server

 

 
Powered by phpBB® Forum Software