Page 2 of 3 <123>
Topic Options
#134521 - 2005-03-02 01:21 AM Re: @wksta
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4549
Loc: USA
At this point, I doubt the variable is defined at all, which may be where Les was headed with Sync/Asych issue...

One last test just to see:

Code:
 

? "Test 5: "
$output=wshpipe('%comspec% /c set',1)
for each $line in $output
if left($line,10 )="clientname"
$found=1
endif
next
if $found=1
"Var Exists"
else
"Var does not exist"
endif

Function WshPipe($ShellCMD, OPTIONAL $NoEcho)
Dim $oExec, $Output
$oExec = CreateObject("WScript.Shell").Exec($ShellCMD)
If Not VarType($oExec)=9 $WshPipe="WScript.Shell Exec Unsupported" Exit 10 EndIf
$Output = $oExec.StdOut.ReadAll + $oExec.StdErr.ReadAll
If Not $NoEcho $Output Endif
$WshPipe=Split(Join(Split($Output,CHR(13)),''),CHR(10))
Exit($oExec.ExitCode)
EndFunction



Top
#134522 - 2005-03-02 01:40 AM Re: @wksta
Faithfulman Offline
Getting the hang of it

Registered: 2005-02-22
Posts: 68
I think you may be right .... with that last snippet of code
it returns:

Var does not exist

So, now what do I do.

?

Thanks for your help

Top
#134523 - 2005-03-02 04:28 AM Re: @wksta
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
EXPANDENVIRONMENTVARS is explained in the KiXtart Manual. I suggest reading it as it also explains how to debug a script.
_________________________
There are two types of vessels, submarines and targets.

Top
#134524 - 2005-03-02 05:24 PM Re: @wksta
Anonymous
Unregistered


So are we saying that the previous posts of code ... use of EXPANDENVIRONMENTVARS ... were done incorrectly??

Because all of the above examples didn't return any value for %CLIENTNAME%.

Top
#134525 - 2005-03-02 05:33 PM Re: @wksta
Faithfulman Offline
Getting the hang of it

Registered: 2005-02-22
Posts: 68
The above message was mine. Forgot to login. Sorry.
Top
#134526 - 2005-03-02 10:13 PM Re: @wksta
Faithfulman Offline
Getting the hang of it

Registered: 2005-02-22
Posts: 68
Does anyone have a moment to help out?
Top
#134527 - 2005-03-02 10:17 PM Re: @wksta
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Have you opened a DOS window on your Terminal server/Citrix desktop and typed "set" <enter> to see if that environment variable is there to use?
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#134528 - 2005-03-02 10:42 PM Re: @wksta
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
I have tested this with a network GPO and the enviro var is not present at the moment the script runs. It is however there after logon if the same script is manually run from the desktop. I think you have no recourse but to put it into a different script run at a later time in the logon sequence. You could try putting it in the 'C:\WINNT\system32\usrlogon.cmd' script or push a link to the RunOnce reg key.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#134529 - 2005-03-02 11:28 PM Re: @wksta
Faithfulman Offline
Getting the hang of it

Registered: 2005-02-22
Posts: 68
Thank you Les for all your hard work. I really could use this in the Login script.

Does anyone know how to push this variable into the initial login script??

Thanks,

Faithful

Top
#134530 - 2005-03-03 01:16 AM Re: @wksta
Faithfulman Offline
Getting the hang of it

Registered: 2005-02-22
Posts: 68
I've been thinking .....

Maybe that would work.

How could I tell the first Kix script to run a second script?

Thanks,

Faithful

Top
#134531 - 2005-03-03 01:25 AM Re: @wksta
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Check out CALL..

For example -

CALL @SCRIPTDIR+'\yourscript.kix'

HTH,

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

Top
#134532 - 2005-03-03 01:36 AM Re: @wksta
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4549
Loc: USA
just Googleing... not sure if this will help or not, but do you have a system variable called WINSTATIONNAME?
Top
#134533 - 2005-03-03 01:50 AM Re: @wksta
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
I take it you are still in denial. I doubt that there is anything that you can do to have that env var populated that early in the logon. Have you given thought to my two suggestions?
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#134534 - 2005-03-03 01:58 AM Re: @wksta
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Jeepers... leave my laptop for a minute and three other posts sneak in there.

CALLing another script is no good cuz the var just isn't there. YOu could push a link to the RunOnce key cuz that is the last thing processed in the logon sequence.

I just had another thought... give one of the helper apps I mention in the FAQ a go. Warren Simondson's ClientInfo should be able to pull what you need since it does not rely on the env var.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#134535 - 2005-03-03 02:27 AM Re: @wksta
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11624
Loc: CA
Well you may be able to just sleep the script for a while if needed. Since Les has experience in this area perhaps he can answer that question. If so, just place a sleep command in your script to wait for this to become available and then it will continue after the sleep.

Top
#134536 - 2005-03-03 02:46 AM Re: @wksta
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
DOC,
Think about it for a second. KiX inherits whatever is in the env at the time it is invoked. SLEEPing for a million years won't change was isn't there.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#134537 - 2005-03-03 09:36 AM Re: @wksta
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Another solution is to use the CTXCINFO.EXE program I cobbled together some time ago to return client information, or Howard Bullocks helper DLLs.

The former definately returns the client name, and I suspect the latter does too.

The site that used to host ctxcinfo.exe is no longer available, so if you want it let me know and I will post it to you.

It was originally documented here

Information on Howards DLL can be found in the Citrix/Terminal Server FAQ.

Top
#134538 - 2005-03-03 02:50 PM Re: @wksta
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
or http://www.kixhelp.com/downloads.htm
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#134539 - 2005-03-03 05:41 PM Re: @wksta
Faithfulman Offline
Getting the hang of it

Registered: 2005-02-22
Posts: 68
Hi All,

Thanks for all your input, I do appreciate it.

I tried calling the second script from the first and Les you were right I got the same result.

Anyway, I need help than ... how would I do this:

Quote:


I think you have no recourse but to put it into a different script run at a later time in the logon sequence.




If I did the RegOnce thingy ... how is this accomplished.

Let me know.

Thanks,

Faithful

Top
#134540 - 2005-03-03 05:50 PM Re: @wksta
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
You could try http://home.comcast.net/~habullock/Perlutilities.htm ClientData.exe and WshPipe UDF to get your information from the user's logon script if were to be execute in a Citrix/terminal server session.

_________________________
Home page: http://www.kixhelp.com/hb/

Top
Page 2 of 3 <123>


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

Who's Online
0 registered and 255 anonymous users online.
Newest Members
Timothy, Jojo67, MaikSimon, kvn317, kixtarts2025
17874 Registered Users

Generated in 0.075 seconds in which 0.026 seconds were spent on a total of 13 queries. Zlib compression enabled.

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