Page 1 of 2 12>
Topic Options
#173660 - 2007-02-05 10:58 PM Enviorment Variables
Faithfulman Offline
Getting the hang of it

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

I'm having a problem with something that seems so simple.

Here is the part of my script giving me troubles:

 Code:
If NOT Exist ("U:\Temp")
	Shell '%comspec% /c md "U:\temp"'
Endif

Set "TEMP=U:\TEMP"
Set "TMP=U:\TEMP"




So basically, we are using citrix and creating a Drive letter for users to login and have their own documents&settings folder mapped to it. The problem lies in the Enviroment Variables.

Even though the U drive is there with the temp folder. It doesn't set these variables correctly. They still point at C:\temp.

Since they don't have access to the C drive, they are getting error messages with some program that need this. After 4 login attempts these changes finally take place. It's almost as if windows 2003 server is still working on building something in to the profile and so it doesn't make these changes.

The users having the troubles are simply windows "Users".

Does anyone know what might be going on??

Thanks!

Faithful

Top
#173664 - 2007-02-06 01:04 AM Re: Enviorment Variables [Re: Faithfulman]
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
Strange, I would expect that the temp variable points to somewhere in "documents and settings", then the username and then "Local Settings". Even on a terminal server.
Top
#173667 - 2007-02-06 02:00 AM Re: Enviorment Variables [Re: Witto]
Faithfulman Offline
Getting the hang of it

Registered: 2005-02-22
Posts: 68
No, it's pointing to C:\Temp even though I am trying to set it to U:\temp. It does seem to finally work after about 4 logins.

Does anyone have any ideas on this matter?

Thanks!

Faithful

Top
#173668 - 2007-02-06 02:03 AM Re: Enviorment Variables [Re: Faithfulman]
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
IMHO, Even if it could be changed with scripting, I do not think you should find your solution there. Has something been changed on the server about the default temp folder?
Top
#173670 - 2007-02-06 02:32 AM Re: Enviorment Variables [Re: Witto]
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Your server is wonked. A properly configured Citrix/Terminal Server manages unique temp locations. Stop mucking with workarounds and fix it.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#173732 - 2007-02-07 06:23 PM Re: Enviorment Variables [Re: Les]
Faithfulman Offline
Getting the hang of it

Registered: 2005-02-22
Posts: 68
We are converting from W2k servers and have just got 4 new W2k3 servers. This is how we were setup with the W2k servers, but this is not working properly with W2k3.

Here is a part of our KixScript:

 Code:
;***********************************************************
; Setup the users working Root drive for their session U:\
;***********************************************************
;
;
SetConsole ("HIDE")
;
;***********************************************************
; Setup the users working Root drive for their session U:\
;***********************************************************
;
$root="U:"
$sub="C:\documents and settings\@userid"
;
;
Use U: /delete
Shell '%comspec% /c subst "$root" "$sub"'
;
;******************************************************************************************
;Create User Temp Directory in U:\
;******************************************************************************************
;
If NOT Exist ("U:\Temp")
	Shell '%comspec% /c md "U:\temp"'
Endif
;

Set "TEMP=U:\TEMP\"
Set "TMP=U:\TEMP\"



Are you saying that W2k3 is incapable of doing this? Why does it work
sometimes? Thanks!

Faithful

Top
#173733 - 2007-02-07 06:41 PM Re: Enviorment Variables [Re: Faithfulman]
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
You might want to "soften-up" that reference to the users profile:

$sub="C:\documents and settings\@userid"

Maybe like:

$sub="%userprofile%"

cause simply appending the userid is not bullet-proof.

Top
#173734 - 2007-02-07 07:00 PM Re: Enviorment Variables [Re: Shawn]
Faithfulman Offline
Getting the hang of it

Registered: 2005-02-22
Posts: 68
What do you mean by not "bullet-proof" ??
Top
#173735 - 2007-02-07 07:19 PM Re: Enviorment Variables [Re: Faithfulman]
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
There are a few instances where constructing a pointer to the users profile (using @userid) falls down ...

1) The instance where a userid already exists on the workstation (say, a local account with the same name) - Windows will create a profile with USERID.DOMAIN to avoid the conflict.

2) If you rename a userid in the domain - the physicial profile on the workstation will not be renamed (thats because Windows maps the SID to the profile - not the name).

3) If you delete a userid in the domain, then recreate it with the same name - since the SID is different, Windows will create a new profile for the user like USERID.000 (assuming that the old profile still existed on the machine and was not cleaned-up before-hand).

Thats my take anyways, anyone else ?

-Shawn

Top
#173737 - 2007-02-07 07:25 PM Re: Enviorment Variables [Re: Shawn]
Faithfulman Offline
Getting the hang of it

Registered: 2005-02-22
Posts: 68
Good point! ... So any idea why the enviromental variable doesn't always map correctly on W2k3?

Thanks!

Faithful

Top
#173738 - 2007-02-07 07:32 PM Re: Enviorment Variables [Re: Faithfulman]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
[edit]
Never mind this post. I should read better
Deleted the contents of the post.
[/edit]


Edited by Mart (2007-02-07 07:36 PM)
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#173739 - 2007-02-07 07:33 PM Re: Enviorment Variables [Re: Faithfulman]
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Not off hand, have you tried tracing-out (displaying-out) the values to the console during a test, so that you can see what things are pointing to ? ...

? "%userprofile%"
? "Hit any key..." GET$

Have you tried using this:

?"ERROR @ERROR - @SERROR"
? "Hit any key..." GET$

after your problem statements, to see whats going on under-the-covers ?

-Shawn

Top
#173741 - 2007-02-07 08:22 PM Re: Enviorment Variables [Re: Shawn]
Faithfulman Offline
Getting the hang of it

Registered: 2005-02-22
Posts: 68
I have been displaying the %temp% before and after I make the changes. But this hasn't been helpful so far. I'll try your idea, if anything else comes to mind, please let me know.

Faithful

Top
#173742 - 2007-02-07 08:55 PM Re: Enviorment Variables [Re: Faithfulman]
Faithfulman Offline
Getting the hang of it

Registered: 2005-02-22
Posts: 68
So far no dice. ... Nothing seems to error out.
Top
#173743 - 2007-02-07 09:14 PM Re: Enviorment Variables [Re: Faithfulman]
Benny69 Offline
Moderator
*****

Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
What Shawn is saying is, strategically place ? var to see what is happening as it happens. If you post your entire script it might be easier for us to help you.


Edited by Benny69 (2007-02-07 09:15 PM)
_________________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)

Top
#173744 - 2007-02-07 09:27 PM Re: Enviorment Variables [Re: Benny69]
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
I still say you are kludging it into place. The proper way is to set in the TSC, "Use temporary folders per session" to "Yes".
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#173745 - 2007-02-07 10:26 PM Re: Enviorment Variables [Re: Les]
Faithfulman Offline
Getting the hang of it

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

We are using ? var to see what is happening. So far, it hasn't helped.
As for your comment Les, We do have "Use temporary folders per session" set
to "Yes". Problem still exists every once in a while.

Top
#173809 - 2007-02-09 07:10 PM Re: Enviorment Variables [Re: Faithfulman]
Faithfulman Offline
Getting the hang of it

Registered: 2005-02-22
Posts: 68
This is still happening every day for the first few logins and then the problem dissappears.

We have been told by the outside company who installed the new servers that their could be a conflict with one of the following things.

1. Primary DC is running Windows 2000 SP3 and Secondary DC is running Windows 2000 SP4 which are running DFS. (Even though this isn't causing a problem with our Windows 2000 Citrix Servers)

2. Incompatibilty between Windows 2003 servers (New Citrix Servers) and the Windows 2000 DC's.

Does this make sense to anyone out there? Or does this sound like someone blowing smoke?

Thanks!

Faithful

Top
#173810 - 2007-02-09 07:14 PM Re: Enviorment Variables [Re: Faithfulman]
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Kinda sounds like smoke to me - idk. But when I get weird Kixtart domain-related errors, I always check the eventlogs on both the "workstation" and on the dc's. Lots of people forget to do this. Sometimes the answer is right there.

-Shawn

Top
#173811 - 2007-02-09 07:17 PM Re: Enviorment Variables [Re: Shawn]
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Have you been able to "corrolate" this problem happening when authenticating against one DC versus another ? I usually just log in and do a cmd "set log" to get that information.

-Shawn

Top
Page 1 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 366 anonymous users online.
Newest Members
Timothy, Jojo67, MaikSimon, kvn317, kixtarts2025
17874 Registered Users

Generated in 0.052 seconds in which 0.015 seconds were spent on a total of 15 queries. Zlib compression enabled.

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