Bokkie Posted April 18, 2006 Posted April 18, 2006 Occasionally I need to delete a file and this works 99% of the time. Once in a while I can't delete the file as the OS (XP) tells me that access is denied as the file is in use by another process. I can't for the life of me identify who that process is so I sometimes have to reboot to get back my legitimate access to the file. Is there anyway in AutoIT of identifying the process that has the file opened? Under normal conditions the file is read and closed without a problem. I've checked all of my .Net code and I can see no exceptions raised during the open and close process so I'm wondering if some internal OS resource is still preventing the file from being deleted. Any ideas?
Valuater Posted April 18, 2006 Posted April 18, 2006 i dont know the exact answer, however maybe give this a try ; Reduce memory usage ; Author wOuter ( mostly ) Func _ReduceMemory($i_PID = -1) If $i_PID <> -1 Then Local $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $i_PID) Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', $ai_Handle[0]) DllCall('kernel32.dll', 'int', 'CloseHandle', 'int', $ai_Handle[0]) Else Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', -1) EndIf Return $ai_Return[0] EndFunc;==> _ReduceMemory() just an idea 8)
pecloe Posted April 18, 2006 Posted April 18, 2006 (edited) not really answering your question but i've read that windows indexing service can lock files. just curious do you have that running? edit: sorry valuater i didn't mean to "step" on you (thats what its called in amateur radio) Edited April 18, 2006 by pecloe
Bokkie Posted April 18, 2006 Author Posted April 18, 2006 Valuater: I'll bear your code fragment in mind but I think pecloe might have hit this on the head as I've not had the problem for a few days now. I was concerned last week about some services in XP that suddenly wake up and nuke my response and spin around 90-100% cpu time. One of them cisvc.exe was a notable culprit and that puppy does the indexing service. I turned it off and I wonder if that might not have been the problem all along? I'll monitor it over the next few days and see if my deletes are stable again. Thanks, both, for your quick response.
w0uter Posted April 18, 2006 Posted April 18, 2006 i use ForceDelhttp://cracking.accessroot.com My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll
Fossil Rock Posted April 18, 2006 Posted April 18, 2006 Try WhoLockMe Agreement is not necessary - thinking for one's self is!
Bokkie Posted April 18, 2006 Author Posted April 18, 2006 Try WhoLockMeI downloaded it, created a directory for it, did the install.bat to regsvr32 it but when I run it, does nothing it!I opened a file and I tried running WhoLockMe.exe in a DOS command window using the file as the parameter but it returns immediately and displays nothing. Am I doing something wrong with it?
Ebenezer Posted April 18, 2006 Posted April 18, 2006 I would recommand this:http://ccollomb.free.fr/unlocker/found it extremely useful Cheers, Felix
Fossil Rock Posted April 18, 2006 Posted April 18, 2006 I downloaded it, created a directory for it, did the install.bat to regsvr32 it but when I run it, does nothing it!I opened a file and I tried running WhoLockMe.exe in a DOS command window using the file as the parameter but it returns immediately and displays nothing. Am I doing something wrong with it?It adds an option on the context menu. Right click on the file that it locked and select 'Who Locked Me?'.That it how it's supposed to be used.I don't use it, I just knew about it and thought it would help. Agreement is not necessary - thinking for one's self is!
Bokkie Posted April 18, 2006 Author Posted April 18, 2006 It adds an option on the context menu. Right click on the file that it locked and select 'Who Locked Me?'.That it how it's supposed to be used.I don't use it, I just knew about it and thought it would help.It's sort of ironic given the nature of the product but I could not delete WhoLockMe! Fortunately, Ebenezer's link to the other unlocker did manage to delete WhoLockMe. So Ebenezer saves the day. Thanks!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now