#1 29 Jan 2007 21:48

daat99
Member
From: Israel
Registered: 29 Jan 2007
Posts: 18
Website

How can I force a delete of folders that contain "used" files?

A bit of a background:
At our system all windows xp machines store the users profiles in partition D.

In order to maintain a "clean" environment we used to have a batch file that formated drive D and than copied back a backup of the default/all/admin user profiles into drive d again.

We tried to "shrink" this long process by creating a batch file that will delete all the directories inside the "Documents and Settings" directory in drive D with the exception of the default/all/admin directories.

We used the following command to delete all the folders that match our criteria (inside a for loop and if conditions where %%i is the directory we want to delete):
rd "%%i" /q /s


The problem:
After a while we started to notice that the batch file is having problems deleting some directories and that it complains about "NTUSER.DAT is being used".

We made sure that we shut down the computers and logged in with a predefined user name before we run that batch file.


The question:
Is there any way to make the batch file delete ALL the folders including the so called "used files" without having to force a format on the drive again?

Thanks in advance

daat99


P.S.
Great website guys, I can't imagine how my life would've been without it wink

Last edited by daat99 (29 Jan 2007 21:49)


I always try to help wink
Sometimes I don't know how sad

Offline

#2 29 Jan 2007 22:09

Simon Sheppard
Super Administrator
Registered: 27 Aug 2005
Posts: 1,013
Website

Re: How can I force a delete of folders that contain "used" files?

you need uphclean, make sure you get the latest version:

http://www.microsoft.com/downloads/deta … laylang=en

Offline

#3 29 Jan 2007 22:25

daat99
Member
From: Israel
Registered: 29 Jan 2007
Posts: 18
Website

Re: How can I force a delete of folders that contain "used" files?

Simon Sheppard wrote:

you need uphclean, make sure you get the latest version:

http://www.microsoft.com/downloads/deta … laylang=en

If I understand the link correctly than it works after the user logs off when the applications he used (that used registry keys) are still running in the background of the WinXP system itself.
In our case the computers are completely turned off and turned back on (not hibernate, sleep or restart, full turn off -> fans stop spinning -> turn on).
How can an application that was completely turned off still use a registry keys for a user that didn't try to log in yet?

Or am I completely misunderstanding something sad


I always try to help wink
Sometimes I don't know how sad

Offline

#4 29 Jan 2007 22:37

Simon Sheppard
Super Administrator
Registered: 27 Aug 2005
Posts: 1,013
Website

Re: How can I force a delete of folders that contain "used" files?

Yes it seems to defy logic, I don't entirely understand all the details, I just know it has a good record for fixing these issues.

Try it and see

Offline

#5 07 Feb 2007 07:17

daat99
Member
From: Israel
Registered: 29 Jan 2007
Posts: 18
Website

Re: How can I force a delete of folders that contain "used" files?

Simon Sheppard wrote:

Yes it seems to defy logic, I don't entirely understand all the details, I just know it has a good record for fixing these issues.

Try it and see

It does work indeed smile
The explanation I could gather is as follows:
It appears that there are several programs (and malicious softwares - malware) that operate on the system startup and not the login.
Those programs apparently load the ntuser.dat file (not in safe mode though) of the user that used them first on the computer before someone even logs in.
That in turn marks the ntuser.dat file as "being used" and doesn't allow the operating system to access it.

In order to fix this issue you have to either restart into "safe mode" and delete the "infected" users profiles manually or just install the "User Profile Hive Cleanup" patch that you provided.

Thank you very much for your help, it certainly makes my life a lot easier (your website even more) smile


I always try to help wink
Sometimes I don't know how sad

Offline

#6 07 Feb 2007 20:23

Simon Sheppard
Super Administrator
Registered: 27 Aug 2005
Posts: 1,013
Website

Re: How can I force a delete of folders that contain "used" files?

Thanks for the extra explanation, on XP machines I think this is often triggered by Virus Scanner updates (which typically run under a system account)

Offline

Board footer

Powered by FluxBB