|
-
Nov 2nd, 2003, 06:02 PM
#1
How can I find out what program is using a file ?
I want to make a Backup program, and the problem is that it cannot backup if the file is in use. So obviously I have to close the program that is using that file, but I don't know how to find out what program is using it... If I could, then I could programatically close the program and start the code that back's up that file...
And by the way, don't tell me "just look for yourself" or something like that, cuz I can't. The backup program should run at 12:00 AM, and I'll be home when that hapens, not at work, where the backup is done.
Anyone has any ideas ?
-
Nov 2nd, 2003, 07:55 PM
#2
I don't think you can tell. Also isn't possible that more than one program will be using the file?
Programattically shut down and restart the computer??
-
Nov 2nd, 2003, 08:53 PM
#3
Yes, it is possible that more than one program is using that file, but in that case (if the function returns only one program), I close the (first) program, then run the function again and returns the second program, and so on... But theoretically if the function returns one program that's using the file, it should return the others also...
"Programattically shut down and restart the computer??"
Well, I would do that if it is possible to restart the computer and return to the same user as it was before (it's on Windows XP). And even then it may be possible that a program that runs at startup to open the file, but that won't happen on the particular system I'm trying to do this...
I just got the idea to enumerate all programs running an close everything except the backup one, but I would rather prefer if I knew exactly what program to close.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|