Page 2 of 2 <12
Topic Options
#209583 - 2014-10-27 11:34 AM Re: Setting Default Printer from partial name [Re: ddady]
ddady Offline
Getting the hang of it

Registered: 2006-09-03
Posts: 98
Sorry for the delay.

I ran the script on debug mode.
It seems that the function works even though that i didn't write it in the script and the function recognize "CtxMtHost" as a session type cause it keeps runing to the next command which is "$session = GetSessionID()"

Is there a command i can add to the script that will display the value in the "SessionType()" function?

I tried adding this:
 Code:
Dim $a = SessionType()
? $a


and i get an error.
ERROR : unexpected command!
Script: \\172.30.168.229\netlogon\IL-CAR\citrixdefaultprinter.kix
Line : 5

Top
#209584 - 2014-10-27 01:03 PM Re: Setting Default Printer from partial name [Re: ddady]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
That does not make sense. You should have got that error already oon the if line. And even if kix treats it as string, "sessiontype" does not equal your string.
_________________________
!

download KiXnet

Top
#209585 - 2014-10-27 01:44 PM Re: Setting Default Printer from partial name [Re: ddady]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
You can display what SessionType() returns by simply typing

 Code:
SessionType()
sleep 5


It should give an error when the UDF is not included in the script.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#209588 - 2014-10-27 06:43 PM Re: Setting Default Printer from partial name [Re: ddady]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4401
Loc: New Jersey
You can't DIM and ASSIGN on a single line - try
 Code:
DIM $A
$A = SessionType()
Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#209589 - 2014-10-28 08:20 AM Re: Setting Default Printer from partial name [Re: Glenn Barnas]
ddady Offline
Getting the hang of it

Registered: 2006-09-03
Posts: 98
Thank you Mart, I'll try it.

Thank you Glenn :-) BTW, until today i'm using your wonderful "Outlook Signature" script. Works like a charm.

Top
#209590 - 2014-10-28 09:17 AM Re: Setting Default Printer from partial name [Re: ddady]
ddady Offline
Getting the hang of it

Registered: 2006-09-03
Posts: 98
OK, when i run
 Code:
SessionType()
sleep 5


I get an error on the "SessionType()" line which means it can't run the function which its what it suppose to do on the line before that cause the function code is not in the script.

When i try
 Code:
DIM $A
	$A = SessionType()
	? $A


I just get in the console "SessionType()" as if the value in $A is a string.

Top
#209591 - 2014-10-28 12:15 PM Re: Setting Default Printer from partial name [Re: ddady]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
You must include the SessionType() UDF otherwise it will never work as it should. Please add the UDF and try again.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#209592 - 2014-10-28 12:41 PM Re: Setting Default Printer from partial name [Re: Mart]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
Yes yes. But why the miracle behavior with if???

I guess someone needs to try and duplicate it...
_________________________
!

download KiXnet

Top
#209593 - 2014-10-28 02:38 PM Re: Setting Default Printer from partial name [Re: Lonkero]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
I just dug up an old Citrix server (Metaframe presentation server) and it works fine on this server. Metaframe presentation server is now XenApp.

Does anyone have a XenDesktop server to test on?
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#209594 - 2014-10-28 04:18 PM Re: Setting Default Printer from partial name [Re: Mart]
ddady Offline
Getting the hang of it

Registered: 2006-09-03
Posts: 98
Most likely i will have a XenApp by the end of next week maybe even earlier.

I will add the UDF and will try again.

Top
Page 2 of 2 <12


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

Who's Online
0 registered and 1574 anonymous users online.
Newest Members
BeeEm, min_seow, Audio, Hoschi, Comet
17882 Registered Users

Generated in 0.074 seconds in which 0.037 seconds were spent on a total of 14 queries. Zlib compression enabled.

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