General discussion

Locked

Net Files Command

By Hojones ·
How do you find a specific file id using the net file command? My goal here is to stop sharing a database using the net file command, so that an it may be overlayed when it becomes unstable yet all of the users attached do not close the database. Sothe net file command will allow me to stop sharing and restore the database.

Thanks in advance.

This conversation is currently closed to new comments.

11 total posts (Page 1 of 2)   01 | 02   Next
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Net Files Command

by Hojones In reply to Net Files Command

Point value changed by question poster.

Collapse -

Net Files Command

by NetTek In reply to Net Files Command

Type NET FILE at the command prompt of the server housing the share. This will show you open files and their corresponding IDs.

Collapse -

Net Files Command

by Hojones In reply to Net Files Command

Poster rated this answer

Collapse -

Net Files Command

by Alpha-Male In reply to Net Files Command

Type NET FILE at a command prompt to see the IDs. Then enter NET FILE id /close (where id is the id number listed in the net file results)

Hope this helps!

Collapse -

Net Files Command

by Hojones In reply to Net Files Command

The question was auto-closed by TechRepublic

Collapse -

Net Files Command

by Lez In reply to Net Files Command

I have the same problem. This is what I do,
From a command prompt on the server,
1) pipe net files list to a text file
c:\net files > files.txt

2) open up files.txt with notepad
c:\notepad files.txt

3) use notepad to search for the file name and get the file ID

4) force the file to close
net file 123455 /close

Unfortunately, I can't do a unix grep, but if you are good with batch files, you can use the find command to list the entries and then close the file automatically.

Collapse -

Net Files Command

by Lez In reply to Net Files Command

I finally created a script to automate the net file and file /close so that I need only to put in the filename or username I want kicked.

---copy the below into a cmd file, i used kick.cmd---

@echo off
if NOT "%1"=="" goto BEGIN
:SYNTAX
@echo Missing Parameter. Syntax is:
@echo Kick [Filename or UserID]
@echo Eg. Kick Document1.doc
goto END
:BEGIN
net file | find "%1" > c:\kick.txt
for /F "tokens=1" %%i in (c:\kick.txt) do net file /close %%i
goto END
:END

Collapse -

Net Files Command

by Hojones In reply to Net Files Command

The question was auto-closed by TechRepublic

Collapse -

Net Files Command

by ITAdmin-Dquick In reply to Net Files Command

or

Goto server manager for domains if you are in an NT environment select the share and click disconnect or disconnect all users

Collapse -

Net Files Command

by Hojones In reply to Net Files Command

The question was auto-closed by TechRepublic

Back to Windows Forum
11 total posts (Page 1 of 2)   01 | 02   Next

Related Discussions

Related Forums