Hi All:
Sorry it took so long i do not check the email that is forum sends to as much as my other accounts. Here is the example that I was talking about.
Pale-Rider

;Script to map multiple network printers from Windows2000 print server to
;Windows 98 client machines. 06/28/2001

;Sorry about the comments, but I thought it might help to have some
;explanation of the steps and our current situation.

;We used this script to add 13 (though only 3 are demonstrated here) indentical
;network printers on 120 user machines. Since we wanted to monitor the addition
;of the printers on each machine and the printers essentially only needed to be
;mapped once (saving users time when they logged in), we decided to create a
;scriptadmin login account and went to each machine and logged in as the
;scriptadmin. Over our network, it took approximately 4 minutes to add all of the
;printers. Much better than adding each one individually which would take about 4
;minutes each. Since all of our printers are pretty much identical, we could use
;the same drivers, which saves a lot of time. However, I have included the basic
;steps to get the drivers for a printer if needed.

;We are running a Windows2000 server and all PCs are running Windows 98. We
;tried a number of the "shortcut" methods, but there are significant
;communication problems between Windows2000 and Windows98 so taking it to the
;tedious level was really the only option we discovered at this point. Basically
;the key in this situation is using keystrokes. We treat the Windows2000 server
;as the "typist" typing the appropriate paths/clicks into the AddPrinter dialog
;boxes. You may need to modify the script a bit to select and enter the
;appropriate data for your setup. If in doubt, walk through the process by hand
;and write down the key strokes then translate them into your code.

;This is not the prettiest script, but I'm new to Windows scripting (this was my
;first one), so I'm sure that someone will come up with a more efficient script
;before long. Obviously some of the script is based on the hard work and examples
;of others. This was fun. Thanks.


;Define printers and print server

$printserver = "master_server"
$printer1="1st_floor"
$printer2="2nd_floor"
$printer3="3rd_floor"

if @inwin = 1

;I'm not sure why this worked, but we need to look at least for the first printer
;before we could start mapping. BTW... we removed all printers before starting.
;We could have looked for all the printers and removed them, but that would have
;taken significantly increased the code, and it was easier for us to just login
;and remove them all.

? ".......Please wait..."
If ADDPRINTERCONNECTION ("\\$printserver\$printer1") = 0
? "Added printer connection to \\$printserver\$printer1 ...."
else
? "Error = @error"
Endif
else

;This opens up the AddPrinter Dialog box.

RUN "rundll32.exe shell32.dll,SHHelpShortcuts_RunDLL AddPrinter"

; Give it time to load up - especially over a network

sleep 1

; hit enter to "begin installing printer"

sendkeys("{ENTER}")

;alt+N to select Network printer, then enter

sendkeys("~N")
sendkeys("{ENTER}")

;alt+N will put the cursor in the "path" text box, the path will be entered in
;using the variables you defined above.

sendkeys("~P")
sendkeys("\\$printserver\$printer1")
sendkeys("{ENTER}")

;If you are adding a printer for the first time, you have to selece the
;appropriate drivers. If all of your printers are the same, such as in our case,
;we only had to do the ;following steps once.
;alt+M puts you in the Manufacturer box, then key in the name

sendkeys("~M")
sendkeys("HP")

;alt+P puts you in the printer driver box, key in the printer driver name (or
;modify code to select from disk...whatever you need to do.

sendkeys("~P")
sendkeys("HP LaserJet 4")
sendkeys("{ENTER}")

;Key in a name otherwise it will be the printer driver name

sendkeys("$printer1")
sendkeys("{ENTER}")

;Select "Do not print test page"

sendkeys("~N")
sendkeys("{ENTER}")

;the first one will take the longest, especially if it needs to install the
;drivers. You may need to bump this value up depending on the speed of your
;network.

sleep 15

;Then into the rest of the printers. If they are all the same, you can use the
;same drivers, as the rest of this code assumes. If you have different printers
;with different drivers, then use the code above.

RUN "rundll32.exe shell32.dll,SHHelpShortcuts_RunDLL AddPrinter"

? "Please wait"
sleep 1
sendkeys("{ENTER}")
sendkeys("~N")
sendkeys("{ENTER}")
sendkeys("\\$printserver\$printer2")
sendkeys("{ENTER}")
sendkeys("{ENTER}")
sendkeys("$printer2")
sendkeys("{ENTER}")
sendkeys("~N")
sendkeys("{ENTER}")
sleep 8

RUN "rundll32.exe shell32.dll,SHHelpShortcuts_RunDLL AddPrinter"
? "Please wait"
sleep 1
sendkeys("{ENTER}")
sendkeys("~N")
sendkeys("{ENTER}")
sendkeys("\\$printserver\$printer3")
sendkeys("{ENTER}")
sendkeys("{ENTER}")
sendkeys("$printer3")
sendkeys("{ENTER}")
sendkeys("~N")
sendkeys("{ENTER}")
sleep 8

EndIf