G
Guest
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 of the directories and that it complains about "NTUSER.DAT is
being used".
We followed the following procedure when running the batch file:
1. Complete shut down (turn off)
2. Wait until the fans stop spinning.
3. Turning on the computer.
4. Logging in with a predefined user that have the appropriate access rights.
5. Running the batch file.
The question:
Is there any way to make the batch file delete ALL the folders including the
so called used "ntuser.dat" files without having to force a format on the
drive again?
P.S.
We were told that the problem is that some programs leave the registry open
for the users that used it but isn't a complete shut down of the system
supposed to solve that?
We're trying to accomplish this without installing further packages/programs.
Thanks in advance
daat99
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 of the directories and that it complains about "NTUSER.DAT is
being used".
We followed the following procedure when running the batch file:
1. Complete shut down (turn off)
2. Wait until the fans stop spinning.
3. Turning on the computer.
4. Logging in with a predefined user that have the appropriate access rights.
5. Running the batch file.
The question:
Is there any way to make the batch file delete ALL the folders including the
so called used "ntuser.dat" files without having to force a format on the
drive again?
P.S.
We were told that the problem is that some programs leave the registry open
for the users that used it but isn't a complete shut down of the system
supposed to solve that?
We're trying to accomplish this without installing further packages/programs.
Thanks in advance
daat99