![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Unlock a file beeing used by another user Hello everybody do you know how to unlock a file for wich the system thinks it is beeing used by another user, like excel or word files ? i mean close every connection to this file by a powershell script ? bye Nico |
My System Specs![]() |
| | #2 (permalink) |
| | RE: Unlock a file beeing used by another user This is not really possible as far as I know. What you can do is that you can get all the file descriptors or "open file pointers" to the file you wish to "release" and see what applications is currently locking it. But from there I'm pretty sure you cant change the "sharing policy". So basically if the FD is set to no sharing, you can only figure out what application is using the file, and if so choose to close that app to relase the file for what purpose you need it. |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Unlock a file beeing used by another user "Don Juan (leidegre)" <DonJuanleidegre@discussions.microsoft.com> wrote in message news 310035B-0071-4F12-AB44-B9E884700170@microsoft.com...> This is not really possible as far as I know. > > What you can do is that you can get all the file descriptors or "open file > pointers" to the file you wish to "release" and see what applications is > currently locking it. But from there I'm pretty sure you cant change the > "sharing policy". So basically if the FD is set to no sharing, you can > only > figure out what application is using the file, and if so choose to close > that > app to relase the file for what purpose you need it. And to figure out which application is using the file, you can use these Sysinternals tools: procexp.exe or handle.exe. You can get these free at: http://www.microsoft.com/technet/sys...s/default.mspx -- Keith |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Unlock a file beeing used by another user I proposed a Community Extensions cmdlet for doing this based on the new Vista restart manager APIs but I'm the only one that voted for it. ![]() http://www.codeplex.com/PowerShellCX...orkItemId=9089 "Keith Hill [MVP]" <r_keith_hill@mailhot.nospamIdotcom> wrote in message news 815F850-9BC0-4443-8695-D131944D0699@microsoft.com...> "Don Juan (leidegre)" <DonJuanleidegre@discussions.microsoft.com> wrote in > message news 310035B-0071-4F12-AB44-B9E884700170@microsoft.com...>> This is not really possible as far as I know. >> >> What you can do is that you can get all the file descriptors or "open >> file >> pointers" to the file you wish to "release" and see what applications is >> currently locking it. But from there I'm pretty sure you cant change the >> "sharing policy". So basically if the FD is set to no sharing, you can >> only >> figure out what application is using the file, and if so choose to close >> that >> app to relase the file for what purpose you need it. > > And to figure out which application is using the file, you can use these > Sysinternals tools: procexp.exe or handle.exe. You can get these free at: > > http://www.microsoft.com/technet/sys...s/default.mspx > > -- > Keith |
My System Specs![]() |
| | #5 (permalink) |
| | Re: Unlock a file beeing used by another user "Marcel J. Ortiz [MSFT]" <mosoto@online.microsoft.com> wrote in message news:uZ%23qaevoHHA.4960@TK2MSFTNGP02.phx.gbl... >I proposed a Community Extensions cmdlet for doing this based on the new >Vista restart manager APIs but I'm the only one that voted for it. ![]() > > http://www.codeplex.com/PowerShellCX...orkItemId=9089 > Yeah I've been thinking that this would be nice but then I thought - Sysinternals and PowerShell are now under the same roof so-to-speak. So I posted a request on the microsoft.public.winternals newsgroup that the PSTools suite (and I should add handle.exe) should be made available in a PowerShell version. I've gotten no response to this post "PowerShelled PSTools - When?" and was starting to get a bit discouraged but then I read that Jeffrey was helping Mark Russinovich out with some PowerShell issues. That's made me a bit more optimistic on this support coming from Sysinternals team at Microsoft. -- Keith |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| open a file, wait for user to amend file, close & process | PowerShell | |||
| Bulk unlock user accounts | VB Script | |||
| [unlock.exe] Software Locked all Privilege and Unable to Unlock | Software | |||
| unlock locked user accounts | PowerShell | |||