Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TEMP directories

Status
Not open for further replies.

masai

IS-IT--Management
Aug 16, 2000
32
US
Does anyone has a useful script that does the following:
- checks all the users that are logged in the server
- CACLS the %SYSTEMDRIVE%\TEMP extracting all subdirectories ownership
- tries to match the first and the second list to find out the "orphan" subdirectories

The reason is that when the user just close the ICA client session window, is disconnected or reset without properly logout, windows will not delete the temp directory and next time the user logs in TSE tries to match the connection number with the temp directory and end up with a directory without rights assignment, what causes some applications to fail with a "access denied" message.
[sig][/sig]
 
I don't have a batch file for this, but you should be able to reconnect to the disconnected session and close it properly.

If not, then you could try using Citrix Server Administrator to log off the disconnected sessions. You will then be able to delete the folders.

It would be pointless finding out the ownership of such files, since they are held open by the system. While they are open, even if administrator owned them you could not delete them.

You either need to close them gracefully, in one of the ways I have described, or by using Server Manager to forcibly close the files. I would only recommend this method as a last resort, as it is not "clean".

HTH

[sig][/sig]
 
Thank you for the tip but I don't believe it matches the point I am talking about.
Does anyone has a script like that?
[sig][/sig]
 
You want to check out flattemp, although beware, there are issues with it. See Microsoft knowledge base articles:
Q234029
Q186516
Q255523

Steve
 
I've had this problem. I would be interested in knowing if you find this script to do it real-time. Basically, I just delete the orphaned accounts on my servers at startup.

I added this line to my autoexec.bat on the servers:
FOR /D %%I IN (M:\TEMP\*.*) DO RD /S /Q %%I

Batch files sure are keen. :)

This script could be modified to check for dates/times on the directories that were created before the longest possible Citrix session, and then be scheduled (via AT).

Let me know how you resolve your issue.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top