Page 1 of 1 1
Topic Options
#76359 - 2003-08-14 04:53 PM Winterm Default Printer
acomire Offline
Lurker

Registered: 2003-08-14
Posts: 3
Hi all -

I have a FR3 server farm will all Wyse 3000 terminals. This is school environment. What I am trying to do is assign a network printer based on the location where the winterm is physically located. Attached is the script I am testing:

SETCONSOLE ("HIDE")

;No printer connection forAdministrators
;SELECT
; CASE @USERID="Administrator"
; EXIT
;ENDSELECT

;Delete all existing networkprinters
DelTree("HKEY_CURRENT_USER\Printers\Connections")
AddKey("HKEY_CURRENT_USER\Printers\Connections")

;Check location depending on clientname
$London = INSTR("%clientname%", "lon")
$Amsterdam = INSTR("%clientname%", "ams")
$Rome = INSTR("%clientname%", "rom")
$Paris = INSTR("%clientname%", "par")

;Connect the right printer to this terminal
SELECT
CASE $London
ADDPRINTERCONNECTION ("\\Servername\Sharename1")
ADDPRINTERCONNECTION ("\\Servername\Sharename1")
ADDPRINTERCONNECTION ("\\Servername\Sharename1")
CASE $Amsterdam
ADDPRINTERCONNECTION ("\\Servername\Sharename1")
CASE $Rome
ADDPRINTERCONNECTION ("\\Servername\Sharename1")
CASE $Paris
ADDPRINTERCONNECTION ("\\Servername\Sharename1")
EXIT
CASE 1
$Selection = MessageBox("Clientname unknown. No printer connections available at this moment. Please contact you system administrator.", "Printerinfo", 64)
IF $Selection = 1
EXIT
ENDIF
ENDSELECT

I know the script is running since I get the message about no printers are available. It seems like the terminal name is not being queried.

Any assisstance would be appreciated

AJC

Top
#76360 - 2003-08-14 05:19 PM Re: Winterm Default Printer
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Are you sure Wyse 3000 terminals have %clientname% set. Without knowing what the clientnames are it is hard to test your code.

Have you tried with debug on to see what the InStr() functions return?
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#76361 - 2003-08-14 05:48 PM Re: Winterm Default Printer
acomire Offline
Lurker

Registered: 2003-08-14
Posts: 3
Thanks for your reply.

The Wyse terminals have a "Terminal Name" field. Based on this script, i am assuming it's looking for the first 3 characters of the name. I changed the terminal name to "london1" for testing to see if the printer I mapped for LON would work.

Forgive me but I am not a programmer.

Thanks again

AJC

Top
#76362 - 2003-08-14 06:57 PM Re: Winterm Default Printer
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
If you are logging into a Terminal Server from a client, it has been our experience that it will pick up the locally installed (client) Network printers.. If these are dumb terminals, then the point is moot. [Smile]

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#76363 - 2003-08-14 07:11 PM Re: Winterm Default Printer
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Yes Kent, I think your point is moot. It would appear the terminals are dumb and the printers are networked.

acomire,
The code appears sound but obviously either there is something you're not telling us or there is no %clientname% set.

Your assumtion of how InStr() works is not entirely accurate. It searches anywhere within the strig and returns the offset of where it found it. None the less, it should still work.

You really should single step through the script in debug mode and check the vars as you go.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#76364 - 2003-08-14 07:42 PM Re: Winterm Default Printer
acomire Offline
Lurker

Registered: 2003-08-14
Posts: 3
Kent -

These are all winterms. I am trying to pull the terminal name from the terminal and map a network printer to it. It's true that all network printers show up, but that is the problem.

AJC

Top
#76365 - 2003-08-14 07:44 PM Re: Winterm Default Printer
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
So.. If they show up, you can't print to them in a session? What is the error message or Eventlog data have in them when you try to print?

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#76366 - 2003-08-15 02:34 PM Re: Winterm Default Printer
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
AJC,

Where does this issue sit? We lost you here..

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1046 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.057 seconds in which 0.024 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org