‘lsof’ for Windows?

‘lsof’ is a program on ‘UNIX-ish’ systems that lets you view open files, and which processes opened those files (from Wikipedia). Its really cool, caus you can use it on a Mac (or linux, whatever) to see what processes are writing to disks, whos looking at your shared files, etc. I used it on my Mac once to see who was listening to my iTunes shares :).

Even though most of you know me as the ‘Mac’ guy, I still use Windows of course. And here at work, we do have a few Windows clients, and we do support quite a few Windows servers, running 2000 or 2003. This morning I rush into work after my shower because a client couldnt access her profile through RDC. Basically, somehow, the machine had locked onto a file of hers, so when she tried to reconnect, it couldnt read her Profile.

This is where lsof would have been nice. Could search for all files matching that users name, and kill the bad proc. Not that easy :). Looking for ‘file locking on windows’ returned just a bunch of results with people/sysadmins/monkeys asking ‘LIKE OMG like how do I like lock a file or folder like my pron folder like so people like can not like get into it’. Great….

So then I come by this article on Wikipedia for file locking. If you look through the ‘File Locking in Windows’ section, they mention a great program, Process Explorer, from Sysinternals (this guy recently got hired by MS actually, or Sysinternals was taken over by microsoft).

This saved my life. After figuring out the UI, I just searched for the users name, and found the proc. that was holding on! Kill that proc, and the user is great! Looking around this program some more, it looks more like Task Manager on drugs! I may try this at home a little bit more to see all the different features, and if this tool can replace many other things missing in Windows…


Listening To: ‘Jump’ by Van Halen


8 thoughts on “‘lsof’ for Windows?

  1. Nice! I love lsof. When looking for one for Windows (and after failing to find one for cygwin), I came across OpenFiles.exe, something which already comes preinstalled on WinXP. Its pretty handy if you ssh into your windows machine and need a command line based program.

    Btw, the the correct link to Process Explorer is here.

  2. Yah, this post was written before Microsoft took them in. Thanks for pointing out openfiles though, i will have to check that out!

  3. What is the “global system signalized is not activated” ? I got this when trying to use openfiles windows comand line.

    I also love lsof for linux and I am looking something similar in windows

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s