Page 1 of 1 1
Topic Options
#144501 - 2005-07-29 08:13 AM Deltree fails, but returns success (0) in Terminal Server 2003
densom Offline
Lurker

Registered: 2005-07-29
Posts: 2
I have a strange issue with using the deltree function within Windows 2003 terminal server which is fine on Windows 2000 terminal server. My objective here is to delete a reg key and then create it again, therefore pruning its subkeys.

The return code on the two commands is 0, meaning that the commands are successful as far as kiXtart is concerned, but this is not the case.
Interestingly enough, this works correctly if the script is executed from within the 2003 terminal server session.

Here's the script:

DELTREE("HKEY_CURRENT_USER\Software\ComputerAssociates\eTrust\SSO\Client\6.5\Cache Users\Profiles\")
ADDKEY("HKEY_CURRENT_USER\Software\ComputerAssociates\eTrust\SSO\Client\6.5\Cache Users\Profiles\")

I put this check before and after these commands to check for a value that I know exists. In both cases it logs "Searched for pykej and found pykej" therefore telling me that the "Profiles" key was never deleted.

$Check = ReadValue("HKCU\Software\ComputerAssociates\eTrust\SSO\Client\6.5\Cache Users\Profiles\pykej\ssoauth", "EnterpriseUserId" )
IF @ERROR = 0
? "Searched for pykej and found $Check"
ELSE
? "Could not find pykej"
ENDIF

To confirm this, I then created a reg file that does the same job. This is the content of the reg file:

Windows Registry Editor Version 5.00

[-HKEY_CURRENT_USER\Software\ComputerAssociates\eTrust\SSO\Client\6.5\Cache Users\Profiles]
[HKEY_CURRENT_USER\Software\ComputerAssociates\eTrust\SSO\Client\6.5\Cache Users\Profiles]

Instead, I ran this at the same point in the logon script with the check before and after:
shell "cmd /c regedit /s \\dfcu-ho-ems\netlogon\reg\delSSOprofiles.reg"

For the first check, I got "Searched for pykej and found pykej"
For the second check, I got "Could not find pykej" which confirms deletion.

The only problem is that I don't want these users to be able to run regedit.exe

I have done all testing with my own username and I am an administrator to this server. Anyhow, the key is current user, so there will be no permission issues there.

This may be an error with KiXtart. I upgraded to version 4.50 today, but previously it was 4.23. I don't know if this is a bug or due to something different about how 2003 handles the registry at logon. I do know that in 2003 I am able to set reg values as part of kix logon scripts

Any help on this one would be greatly appreciated.

Cheers

Top
#144502 - 2005-07-29 02:54 PM Re: Deltree fails, but returns success (0) in Terminal Server 2003
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Truly odd. I know terminal server does smoke and mirrors on some of the reg which is why you have to put it in install mode so it can watch the reg for changes. That said, DelTree() should not return 0 unless it is successful and the OS restores the deletion.

Have you tried the command without the trailing hack '\' as shown in the manual?
$ReturnCode = DelTree("HKEY_CURRENT_USER\EZReg")

Are all your tests during the logon sequence or are you testing after logon? Which tests, the KiX DelTree() or the RegEdit merge?
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#144503 - 2005-08-01 07:45 AM Re: Deltree fails, but returns success (0) in Terminal Server 2003
densom Offline
Lurker

Registered: 2005-07-29
Posts: 2

Thanks for the response.

I was testing this during logon. I don't know how, but when I had Kix delete and then create the "Profiles" key, somehow the extra keys would end up ammended onto that.

In one case, the extra keys weren't there before the delete and they were there after the add. With regedit, this did not happen. I found it to be either Windows 2003 or the SSO software. Now I only delete the "Profiles" key and my SSO software recreates it for me, so its good, but still strange.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, 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.05 seconds in which 0.023 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