I've had success with Sysinternals Process Explorer. With this, you can search to find what process(es) have a file open, and you can use it to close the handle(s) if you want. Of course, it is safer to close the whole process. Exercise caution and judgement.
To find a specific file, use the menu option Find->Find Handle or DLL...
Type in part of the path to the file. The list of processes will appear below.
If you prefer command line, Sysinternals suite includes command line tool Handle, that lists open handles.
Examples
c:\Program Files\SysinternalsSuite>handle.exe |findstr /i "e:\"
(finds all files opened from drive e:\
"
c:\Program Files\SysinternalsSuite>handle.exe |findstr /i "file-or-path-in-question"
This is the exact use case for setting up a domain. I would HIGHLY recommend you do so. You'll be a much happier and saner admin when you do.
I take that back, since the students do own the laptops forcing them on the domain isn't such a good idea.
What I would do in your situation is this:
In the image setup a common admin UN/PW combo so that they all have a common admin account coming from the factory. Then, when you distribute the machines - and this is where it could get sticky as far as manpower - give a class on basic administration. Things like:
- How to change the admin password
- How to create your own limited account - and why it is a good reason to use that day to day
- How to setup file sharing
- How to access the school's student resources from the laptop
- Depending on the age of the students - where to get free development tools
- Visual studio express
- Eclipse
I would also talk to some of the more tech savvy students to see if they would be willing to volunteer time after school to help other students - basic tech support, re-image as needed, general help. Not only does that take some of the work load off you - but gives the students something to put on their resume / college applications if they choose to go into IT (or preferably go to college THEN into IT)
To address the control comment, just because they are on a domain doesn't mean you can't make the students group power users or local admins. In fact it would let you only set that on certain machines - so you could have a set they couldn't mess up.
For the user creation on login - you'd have to write some sort of hook into MSGINA i think - i've been out of education tech too long to know if that exists.
In any case, I would suggestion you look into something like deep freeze to prevent the machines from getting tooo messed up.
Best Answer
The recommended way is to use the WAIK, but at the very least you should be using sysprep on the "master" image before capturing the image and deploying it.
http://technet.microsoft.com/en-us/library/dd349343(WS.10).aspx