Discussion Locked

Scripting help needed

0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I have a situation on a brand new network (Win2K server, WinXP Pro workstations) where they are (unfortunately) still using a number of DOS programs. They need to be able to print from these programs, obviously, so I need to capture a printer port to a specific printer for each user. The problem: I need a method of capturing the printer port to that user's default printer as he or she logs on. IOW, I don't want to have to go to each workstation individually and create a persistent port mapping. I want to be able to do it from a login script. My only problem is that I don't know how to identify the user's default Windows printer - does anyone know of some variable or scripting whiz-bang that I can use that will be able to find this information as the user logs on?

1 reply

by timthetoolman

Hi Synergy,

Long time no post (for me) :-)

I suggest WSH. Heres an example of reading from the registry...

http://www.winguides.com/scripting/reference.php?id=146

And here's where you'll find the printer port on WinXP. You may need to hunt a little for Win2K if its different.

hkey_local_machine/software/system/currentcontrolset/control/print/printers//port

The default priner (to get the printername) is in that same areaish too in WinXP

Hope that helps!

Cheers,
Tim.

This discussion is closed to new replies.