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?
-
Zardoz2293
- Posts: 616
- Joined: 09 Nov 2011 20:20
- Location: USA
Any scripting command or method to retrieve file lock status?
MacOS Tahoe v26.5.1
VM (Client): Windows 11 Pro (AArch64), 25H2.26200.8655 (10.0)
Display: Main=MacBook 4112 x 2658 @200%; External 3840 x 2160 @125%
VM (Client): Windows 11 Pro (AArch64), 25H2.26200.8655 (10.0)
Display: Main=MacBook 4112 x 2658 @200%; External 3840 x 2160 @125%
-
highend
- Posts: 14948
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
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
XYplorer Beta Club