Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: network file in use
What I'm looking for is a way to determine IF the file is in use & When it's NOT in use copy the new one over it. That way I can start a winbatch prog & go home & it'll copy the file out, log the time (so I'll know it got done) & then log the PC off & shut down.
I can do ALL that EXCEPT tell if the file is in use.
I've tried "AppExist" , "FileSize", "wntFileClose", & looked around on the Web board & tech support & tried everything I found with no luck.
This first program can be generic and used by all network programs as well!
Hopefully you don't need to update the first program very often...
;* Determine if this is Windows 95 or Windows NT If WinMetrics(-4) == 4 Windows = "NT" Endif If WinMetrics(-4) == 5 Windows = "95" Endif If Windows == "NT" AddExtender ("WWWWNT34I.dll") Else Message("Error","You must be on an NT workstation to execute this command") exit Endif Filetocheck="q:\q drive\mis\database\global.mdb" GoSub CheckFile exit :CheckFile users=wntFileUsers( "\\MSO",filetocheck) totusers = ItemCount(users, @TAB) cnt = 0 while cnt < totusers cnt = cnt + 1 if cnt <= totusers ; ...do something with the information newline=ItemExtract(cnt,users,@tab) display(1,"user accessing file",newline) Endif EndWhile return
Article ID: W14265
Filename: How to determine if a file is in use on LAN.txt
File Created: 2001:03:01:14:16:30
Last Updated: 2001:03:01:14:16:30