Dempex Posted March 26, 2005 Posted March 26, 2005 When a single file is shared between 4 programs. Is it possible to "test" on that file how many is in it at the same time ?????? Its driving my brain nuts those days but if one have some ideas it would really be great. I dont have anything with the 4 programs to do, they are working in dependent of me
buzz44 Posted March 26, 2005 Posted March 26, 2005 (edited) i remember reading somewhere about a program/autoit script (maybe on forums) that checks to see what a file is being used by. edit: maybe i just dreamed it lol... Edited March 26, 2005 by burrup qq
sylvanie Posted March 26, 2005 Posted March 26, 2005 Hello, I remember that you have asked a similar question.I have already told about http://www.sysinternals.com/ntw2k/freeware/handle.shtmlIf you use this program with this script, I think that it could help you (I hope);test if a file is used by several processes $fic=FileOpenDialog("Chosse the file to monitor",@MyDocumentsDir,"(*.*)",3); file to monitor if $fic=-1 then Exit $fic='"'&$fic&'"' Runwait(@ComSpec & " /c handle.exe "&$fic&" > "&@TempDir&"\loghandle.txt","",@SW_HIDE) $fic2=FileOpen(@TempDir&"\loghandle.txt",0) $index=6; the list of processses begin at the line 6 $nameprocesses="" while 1 $line=FileReadLine($fic2,$index) if @error=-1 or $line="No matching handles found." then ExitLoop $tab=StringSplit($line," ") $nameprocesses=$nameprocesses&$tab[1]&" PID "&$tab[9]&@CRLF; for each line the first element is the name of the process and the PID is 9th $index=$index+1 WEnd MsgBox(0,$fic& "is used by :",$index-6 &" process(es)"&@CRLF&$nameprocesses)
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