Find and Remove file locks

  • Section(s): Miscellaneous
  • Published on Apr 20, 2004.
  • Last Modified on Apr 20, 2004.
  • Last Modified by Wayne Maples.
  • Rated 4.5 out of 5 based on 31 votes.
To find open files, from the command line, issue net file command. Text similar to the following will print to the screen:
ID   Path                              User name     # Locks
------------------------------------------------------------
10   C:\images\desktop.gif             wmaples          0
18   C:\images\wayne.gif               wmaples          0
23   C:\apps\sharedpgm\config.txt      wmaples          1
28   C:\dept\its\wmaples\profile.txt   wmaples          0
The command completed successfully.
desktop.gif, wayne.gif, config.txt, and profile.txt are open files on the server. config.txt has a lock on it. It is not uncommon for a shared config file to get a stuck lock which prevents other users from starting the application. To delete the lock, issue command net file 23 /close. Notice you use ID number.

About Wayne Maples

Share this article


Article not looking right or info is missing? Let us know so that we can fix it: .


Receive all the latest articles by email!

Receive Real-Time & Monthly WindowsNetworking.com article updates in your mailbox. Enter your email below!
Click for Real-Time sample & Monthly sample

Become a WindowsNetworking.com member!

Discuss your network issues with thousands of other network administrators. Click here to join!

Community Area

Log in | Register

Limited time offer!

SolarWinds screenshot

Subscribe to WindowsNetworking.com Newsletters today and get a free copy of the new SolarWinds Exchange Monitor!

Readers' Choice

Which is your preferred software-based Backup solution?