I have a Windows 7 computer that is hosting some files in my network. Sometimes a file (usually an Office document) is stuck in the open state even after a user has finished editing it. What I do to resolve this is to go to Computer Management > Shared Folders > Open Files and close the connection to the culprit file.
However, I always have to do this by remote controlling the host computer. Is there a faster way to accomplish this? I'm open to anything that can help me speed up the process (batch, powershell, remote MMC, etc).
What I've Tried:
I've tried using Remote MMC from my workstation into the host, but when I try to open System Tools > Shared Folders > Open Files I get error You do not have permissions to see the list of files opened by Windows clients.
Edit:
While remote commands are great, and I'd be open to using them, I need a way to both list the files, identify which one I need closed, and close it in relatively the same amount of time that it would take to use the MMC snap-in to do it through the GUI.
Answer
From this TechNet article :
To close an open shared file or folder by using the Windows interface:
- Open Computer Management.
- If the User Account Control dialog box appears, confirm that the action it displays is what you want, and then click Yes.
- Go under the Action menu and click Connect to another computer . . .
- In the console tree, click System Tools, click Shared Folders, and then click Open Files.
- Do one of the following:
To close all open files and folders, on the Action menu, click Disconnect All Open Files.
To close a specific file or folder, in the Results pane right-click the file or folder name, and then click Close Open File.
To disconnect multiple open files or folders, press the CTRL key while clicking the file or folder names, right-click any one of the selected files or folders, and then click Close Open File. This closes the selected files or folders.
To close an open shared file or folder by using a command line
- To open an elevated Command Prompt window, click Start, point to All Programs, click Accessories, right-click Command Prompt, and then click Run as administrator.
- If the User Account Control dialog box appears, confirm that the action it displays is what you want, and then click Yes.
- Type:
net file
For example, to close an open file identified as myfile_id, type:
net file myfile_id /close
No comments:
Post a Comment