You may also try this method,
Delete A File That Is Seemingly "Undeletable"
http://www.theeldergeek.co
Main Topics
Browse All TopicsI am trying to delete a bunch of files (a profile folder, actually), but they are in use. "Cannot delete ntuser.dat: It is being used by another person or program. Close any programs that might be using the file and try again." [OK]
And if I try and edit / open NTUSER.dat in notepad, "The process cannot access the file because it is being used by another process."
I am NOT logged into this current user, and the files should NOT be in use. If you would like to know more information I can elaborate. I need to know what is using these files, and how I can close those processes and/or services so these files get deleted when they are supposed to.
This is replacing another question that I've had open in this TA for the past 2 days, but received no comments.
Thanks in advance,
~ Jonny
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
You may also try this method,
Delete A File That Is Seemingly "Undeletable"
http://www.theeldergeek.co
try this utility to see what has it locked
http://www.dr-hoiby.com/Wh
No... I guess a little background is in order. We use Novell to delete the local roaming profile from the workstation hard drive after the user's profile is loaded up to the server. Novell starts to delete the profile but hits the locked files and gives up. Now I'm left with no profiles registered in windows, but a partial profile folder in the Docs and Settings area. Now the next time the student logs in, Windows sees the folder and decides it can' overwrite a profile folder, so it adds ".000" to the end... and basically that just starts screwing things up.
I just replicated the problem cleanly and closing explorer did not help. I even tried deleting the file from a command prompt while explorer was not running, and it still reported being in use. I'll run the above utility again and see if I can find somethine else using the file...
~ Jonny
The root of "system" - using:
C:\Documents and Settings\8averykevin\ntuse
C:\Documents and Settings\8averykevin\NTUSE
Can I close this thread/process without screwing my windows session over? My goal is to allow the student to log off without having to restart in order to restore functionality...
hehe yeh I think I just made Windows have a heart attack :o)
So now the question is why is it in use by "System" and how can I fix that? Do services run under this single process/handle? Is it possible that a service is not closing properly? Not putting things back the way they should? There is an autocad service, I haven't narrowed it down to this service running or not, because when autocad is launched there are plenty of different proceses that run...
Just kind of thinking out loud here. Any ideas guys?
here's an idea, create a batch file to delete these files
and then see
AutoExNT Service allows you to start a batch file, Autoexnt.bat, at boot time without having to log onto the computer on which it will run.
http://www.dynawell.com/su
then when the student logs on, the folder(s) should be gone
hmmmmmm novell... i have never used it, so dont have any idea that if you cannot use safemode or safemode with command prompt for deleting the profile files present on the hard drive.... mostly when we cannot delete the files in GUI interface, we use safemode with command prompt to delete the files from the hard drive as in command prompt there is no possibility of background process or services :)
New question: I have a service set to go as a specific user. I have entered the password and everything, and it says "The account .\user has been granted the Log On As A Service right." I can then start and stop the service successfully. But as soon as I log out and back in, it is not authenticated anymore. The error that comes up now when I try to start the service is: Could not start the Run Autocad Licensing service on Local Computer. Error 1069: The service did not start due to a logon failure." If I retype in the password and try to start the service again, it works. Why isn't it keeping the authentication information?
>> here's an idea, create a batch file to delete these files
and then see
AutoExNT Service allows you to start a batch file, Autoexnt.bat, at boot time without having to log onto the computer on which it will run.
We thought about that, but the problem is that if the user logs out after being the first to run autocad, his profile folder is now locked and partially there. If he restarts and we have this batch file run on startup, then yes it can get rid of those extra files lying around. But if the student just logs out, and the next period happens to come back and logs back in, the files will still be locked, and unable to be deleted.
Requiring a student to restart the computer would be a solution... we found that if we restart instead of logging out the files are not locked. this is our "last resort" solution though... much rather would be able to have the students be able to log in and out without any problems.
OK Forget everything up to this point. Take a look at this.
Autocad uses a licensing service, which runs when autocad runs, and it doesn't do a good job of cleaning up. Here is my problem now:
If I am logged into the computer (doesn't matter which user, I'm using Administrator as the example), and I start the service, and stop the service manually, it screws around with that Administrator profile - which is great, because now any other user can log in, log out, the service seems to work correctly with their profiles. The service is set to run under the Local System account.
I created a batch file to run at system startup:
echo off
net start "Run Autocad Licensing"
net stop "Run Autocad Licensing"
Now, i'm assuming, because I wasn't physically logged into any profiles, it didn't lock anything up. The next time I ran the service in a user account, the files were locked and again not deleted.
So my question is: what is the difference between running this service as Local System while I am logged in as Administrator, as opposed to running the same service from the same batch file before anyone has logged in?
~ Jonny
>> what is the difference between running this service as Local System while I am logged in as Administrator, as opposed to running the same service from the same batch file before anyone has logged in
this is just a guess, but I think it may have to do with some services starting when a user logs on
Hoping that 500 points may attract more to look into the problem and for you guys to keep at it!
>> this is just a guess, but I think it may have to do with some services starting when a user logs on
OK, well that batch file ran automatically as soon as the system started up, before I logged in as any users. Is there anywhere I can see that the service started and stopped appropriately? Like a log or something?
So your problem is that this service runs as the user and so the users' settings are in use?
First, you might create a new account that you don't need to move or delete or whatever (perhaps a local account) and run the service as that (edit the service and have it run as the local administrator).
You might also stop the service when people log on and stop it when they log off (or even when they start the program that needs the service and stop it when the program ends).
This is autocad licensing so look into setting up a network service and move it off the desktops, you might have to pay more but perhaps you can run the licensed program on more desktops (even in remote locations that are still attached to the network).
You can add the following to the Script to debug. The script may be running as an account that doesn't have permissions to start and stop services so you can run the script later as the same user.
ECHO Restarting Service as %username% >>C:\debug-acadl-logfile.t
I also quickly considered adjusting the script so it used RUNAS /user:admin "net stop.." or you might actually need to use PSEXEC from wininternals to use a runas with a password in a script file.
Tymes... so many of these suggestions have gone through my head, some I have played with, others I did not know where to start. If you could please continue watching this thread, I will be picking up again first thing in the morning (sigh...) and will start checking these things out.
About creating the log file: I spent roughly 45 minutes just searching for that. I can't believe it is that simple and googling didn't find anything. I am very interested to see if those services did indeed start. The batch file ran, but I dont think I have any way of seeing if the services failed or not.. so I figured maybe I can work on making a log. Either that or would it be in the event viewer? Forgot about that until just now...
Until tomorrow, have a good evening guys.
~ Jonny
to also append the status of the service to the log file add a
SC QUERY "Run Autocad Licensing" >>C:\debug-acadl-logfile.t
looking at this example you'll see my spooler is running (so I have to go catch it)
SC QUERY spooler
SERVICE_NAME: spooler
TYPE : 110 WIN32_OWN_PROCESS (interactive)
STATE : 4 RUNNING
(STOPPABLE,NOT_PAUSABLE,AC
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0
How can I write custom text to this log, so I can follow the entire process all the way through?
For instance I'd like to see in the log...
Batch Started
Starting Service
[Query Service]
Stopping Service
[Query Service]
Batch Ending
Also, how are is it to get timestamps?
Thanks for your help. I'm in the lab working on this now so hopefully I will figure some things out.
~ Jonny
OK I'm back to having the batch file run at system startup. Sometimes it starts, sometimes it doesnt. The first time I tested, it started, worked, had the 3 entries in the log (i'll post my batch code below), and the problem was actually solved. Figured I should restart and log in directly as a student, but this time when I logged back in as administrator, I saw that the event had "failed to start." Why? Where can I see why it is failing? Does it matter who I log in as? Shouldn't it run the event (and the batch file) as the person whose credentials I entered (I used administrator account) even if no one logs in???
Batch file:
echo off
sc query "Run Autocad Licensing" >>C:\acad.log
net start "Run Autocad Licensing"
sc query "Run Autocad Licensing" >>C:\acad.log
net stop "Run Autocad Licensing"
sc query "Run Autocad Licensing" >>C:\acad.log
So how did you set this system startup batfile to run? In the Program start folder? Right click on the shortcut and change the permissions to RUN AS the administrator (remember to restrict the write/modify permissons on the batfile that you run as an administrator). Or did you make it a scheduled event that starts when the computer starts or when the person logs on? Make it a scheduled task might help you.
Adding "ECHO %TIME% %USERNAME% >> C:\acad.log" would tell you who the script was running as.
It seems like this stupid service is just plain poorly written.
As I said, if I start and stop the service manually in the ./user profile, then it will lock up just that profile, leaving other users to turn on and off the service as needed, without locking their profiles.
What I ended up doing in place of scheduled events was to link my batch file into a new Automatic Service, running itself as the ./user account (which has administrative rights). It ran, and I did figure out how to log everything, so I see that everything ran properly. I logged in as a student, ran autocad (thus starting this service) and then logged back out, only to find that the studen't profile was locked... again!
Autocad is of no help, as they claim it is a problem with our setup, as opposed to with their service. I am completely out of ideas. This question is worth 500 points, because I really have no further ideas.
Something to keep in mind: *logging out* after using autocad for the first time since booting the computer keeps some files in the user's profile open, thus locking it. Bypassing log out and directly *restarting or shutting down* after using autocad for the first time since booting the computer releases those files, and our Novell does its job completely, bringing the roaming profile up to the server, and then deleting the profile and its files from the local system.
I am about to tell the students to just restart every time they want to log off... this is such a mess :(
PLEASE, if you have any ideas at all, let me know.
~ Jonny
After a restart. And I'm not using that anymore, since I seemingly couldn't get it to remember the 'user' account's password... guess it has a bad memory. If you look above, you will see that I made the batch file run as an automatic service, and the service is running under the 'user' account.
Does that clear it up?
Thanks
This is still unsolved. Autodesk is of no help, nor did posting on the user forums on their site help. I have posted a new question to see if I can get a workaround - restart the computers and delete the access profile folders once a week, night, whatever we need to do. The question can be found here: http://www.experts-exchang
If you don't mind, I am going to leave this question open for a while. It is an issue that ultimately needs to be solved. If after a week or two we can't find anything, I will ask that the question be PAQ'd and give out some points for those that at least got me closer to the solution. Does this sound fair?
Thanks,
Jonny
If this value is enabled After a user logs off from an interactive session, the locally cached version of the roaming User Profile is deleted.
HKEY_LOCAL_MACHINE\Softwar
DeleteRoamingCache REG_DWORD 0=Off or value is removed; 1= On.
To do something manually, use DELPROF.EXE in the windows resource Kit. You can have it delete profiles that haven't been used in a specific number of days...
DELPROF.EXE /q /i /d:5
quite, ignore errors, profiles 5 days old.
Didn't work :( Worth a shot though. The problem here is that Novell is removing the roaming profiles already, this isn't technically a roaming profile "cache"... For instance if I pick any given computer in this particular lab, there are a bunch of profile folders left over in C:\documents and settings, all from users launching autocad after a restart. But, if I go into Users and Groups under Comp Management, or even under Profile Information under System preferences, only the 2 local users show up (Administrator and User). This is because Novell successfully removes the profile from windows, but while trying to remove the user's files, when it hits the locked file, it just gives up on deleting the rest of that profile folder. Now I'm left with a non-user profile folder (like, it's not bound to any users... it's as if you had just created a new folder in Documents and Settings and stuck a bunch of files in there), and the next time that user logs in, Windows creates a new folder and calls it username.000.
Just typing that gave me an idea. By default, windows will not overwrite profile folders in Docs and Settings. For instance, let's say I have a new user named "Joe" but have not logged him in yet, and I go create a folder called "joe" in C:\Documents and Settings. Now when I log him in for the first time, Windows will not overwrite the folder that is already there, nor will it just incorporate whatever is in that folder into the profile... instead it makes a new folder called "joe.000" (I have also seen username.computername or username.windows, but windows seems to favor the .000 in our case). Can I somehow tell windows to just use the folder that is already there? So even if I already have "joe" in there it just overwrites the old files with those from the profile.
~ Jonny
Tymes,
How might I do two things if an IF statement comes out to meet the conditions?
If [condition] [command 1] [command 2]
Looking for logging puposes so I know which directories are being deleted. It's nice to know that the script is running when it's supposed to, but I just want to be able to go into my log and see that a bunch of folders were deleted too.
Thanks
Well guys I am going to ask that this question be paq'd and points refunded. The issue was definately with the Autocad service, and Autodesk is not willing to admit that. Our solution was to get rid of any lingering profiles every time the computer starts up. See my other question which has since been closed for more information: ttp://www.experts-exchange
I Plan on giving out points to those who did help over here. I just don't think I should accept anything as an "answer" in this question as apparently there is none, or that Autodesk just threw that service out there without full testing.
Thanks again for everyone's help.
~ Jonny
A link might help:
http://www.experts-exchang
well, if those web pages doesn't work, just star on "safe mode", restar ur system, so when boot press f8 on keyboard several times until the screen shoes boot screen, then select "safe mode"... when windows stars, try to delete the files u need selectin' those files and press "SHIFT+SUPR"... that's all! good luck
HP
Download Moveon boot.
http://www.gibinsoft.net/g
30 day trial, just locate the file/s reboot files gone.
colin.
in regards to your question pertain to IF statements in bat file sy
if "%var%"=="2" (
rem do this stuff
) else (
rem do other stuff
)
so
if 1==1 (echo yes) else (echo no)
will say yes
if 1==2 (echo yes) else (echo no)
will say no
Rather than deleting files, you might try renaming them and deleting them a iteration later.
del %userprofile%\*.former && rem del files from a while back.
ren %userprofile%\*.* *.former && rem rename existing files that may be in use
sometimes you can't delete inuse files but you can rename them.
I WAS successful in deleting NTUSER.dat -- Windows XP Professional w/SP3. I started the PC in safe mode, logged in as administrator, and deleted the entire directory for the users that had the NTUSER.dat file. I had tried MOST of the suggestions posted, and logging in as Administrator in SAFE MODE was the ONLY SOLUTION to get rid of the UNRULY NTUSER.dat file.
Business Accounts
Answer for Membership
by: SheharyaarSaahilPosted on 2004-11-17 at 06:47:07ID: 12604461
Hello jonnyz0109 =)
m/ntw2k/fr eeware/pro cexp.shtml
Use this tool >> http://www.sysinternals.co