Is there any existing scripting command or example(s) of retrieving a files lock status. Example: a file is open and has any kind of lock flag, a return value from the call could be evaluated to know it is in fact locked.
Why? To prevent scripting commands which halt from trying to perform an action on a file which is locked. i.e., "renameitem"
Error "The process cannot access the file because it is being used by another process."
Thanks!
Any scripting command or method to retrieve file lock status?
-
- Posts: 577
- Joined: 09 Nov 2011 20:20
- Location: USA
Any scripting command or method to retrieve file lock status?
Computer/Systems Background = Expert | Windows 10 Pro (64-Bit) | Dell Precision 7720
Re: Any scripting command or method to retrieve file lock status?
Windows brings "openfiles" (which is not really easy to use).
Handle (https://technet.microsoft.com/en-us/sys ... 96655.aspx) could be used and it's capable of
unlocking handles as well (but needs admin rights)
VBscript can't do it in a 100% reliable way...
Handle (https://technet.microsoft.com/en-us/sys ... 96655.aspx) could be used and it's capable of
unlocking handles as well (but needs admin rights)
VBscript can't do it in a 100% reliable way...
One of my scripts helped you out? Please donate via Paypal