Hi,

first thx to all.
OK, in my testenvironment now i runs an WINS-Server under Windows NT40 Server.
Unfortunely many of my clients log on locally and not on a dömain.
Thats causes that i have to set the default printer per client-IP-range (printers connected on a HP Jetdirect).
E.g.

Client IP: 10.20.33.50
ClientName: Wilma

On the Terminal-Server is a local printer installed (port: 10.20.33.20_P1, this is the HP Monitor), the Printer is shared as "HP4000-1".

The specific problem is, is must set the default-printer per each terminalclient to its location.
E.g.
"Wilma" is connectet to the Server and prints per default on "HP4000".
So, for each location is a printer installed.
Now an exampel of my script:

$IPAddress=@IPAddress0
$oct1 = LTrim(Substr($IPAddress, 1, 3))
$oct2 = LTrim(Substr($IPAddress, 5, 3))
$oct3 = LTrim(Substr($IPAddress, 9, 3))
$oct4 = LTrim(Substr($IPAddress, 13, 3))
$IPAddress = "$oct1.$oct2.$oct3.$oct4"

SELECT
CASE "$oct2.$oct3" = "20.33" ; 2nd & 3rd octet of the Client IP
IF SetDefaultPrinter ("HP4000-1") = 0
CASE "$oct2.$oct3" = "20.36"
IF SetDefaultPrinter ("HP4000-2") = 0
CASE 1
SetDefaultPrinter ("HP4000-3")
ENDSELECT

[Edit]
The terminal-server and the client are not in the same sunbet and the printserver is located at the client.

[ 28 May 2002, 15:46: Message edited by: Jacks0r ]