The purpose of this script is to unlock a file located on a shared folder. The server which hosting the shared folder is configured in the variable $nas_server
This script works on Windows 2008/Windows 7 and uses the tool “openfiles.exe” (
The script users will need, at least, to be a member of the “Power users” group on the nas server

To avoid any problems regarding the length of the paths, please check and set your powershell console screen width to “500” :


Script :

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Social Media Auto Publish Powered By :
%d bloggers like this: