Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is my file in use?

Status
Not open for further replies.

JHerr

Programmer
May 25, 2001
42
0
0
US
Hi! i need a quick way of checking if a file on a network pc is IN USE, as in running. I connect to several network pc's ihave listed in a listview, and i map a network drive of X to them. then i copy an updated file to the correct folder. however i am adding the ability to check the file's information before you copy. i use the filesystem object to check the exe's version number and updated date, but i want to know if it is currently in use. i did use one thing invovling copying the file and deleting, and if i got an access denied error, i know it was in use, but his proved to time consuming on multiple pc's. i need YOUR help! any suggestions?
-jacob
 
Try opening the file for lock read access using the open statement. If the open fails then the file is in use. That still involes error trapping however.
 
great idea VBGuy!! i hadn't even thought of that!! It works beautifully!!
-jacob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top