Unlocking files that are in use

Sometimes you cannot delete or rename a file that is currently in use. You might receive an access violation error, or simply a message telling you that your action could not be completed because the file is open in another program.

image

You may have already come across the Unlocker freeware tool that lets you “unlock” files that are in use by some application.

Here is another way (let’s call it the ‘techie’ way) to unlock files that are in use. It makes use of the Process Explorer tool from Windows SysInternals.

  • Download the Process Explorer tool. Execute procexp.exe
  • Choose Find Find Handle or DLL option

image

  • Type the name of the file you want to unlock and hit Search.

image

  • The process EXE locking the file and the path to the file are listed. Double click on the result.

image

  • The file handle will be highlighted. Right-click on it and choose Close Handle.

Your file is now unlocked and can now be deleted, moved or renamed.

A little disclaimer here, closing handles might cause data inconsistency, loss and/or other undesirable effects. Make sure you understand what you’re doing before you do it.

Add RunAs to Explorer Context Menu in Vista and Server 2008

As a Domain Admin for a small or large corporation, it’s NEVER a good idea to login as the Domain Admin (or other privileged user) to read email or surf the Internet.  After all, if you pickup a nasty bug/virus, from Outlook or Internet Explorer your logged in credentials will have the ability to spread the virus to every system in the company…  Not a good thing!

 

That’s where the RunAs command (XP and Server 2003) came in handy over the years.  You could login as a non-privileged user but if you needed to do something which required Admin rights, you could hold down Shift and Right Click on the application in Windows Explorer and start the application using your Admin credentials.

 

With the release of Windows Vista and Server 2008, this all changed.  True, you could still use the RunAs.exe from the command line however, if you wanted to do it with Windows Explorer.  Fortunately Mark Russinovich has written a new tool called  which adds the RunAs feature to Windows Explorer.

 

Follow the below Step by Step to get it rolling on your box:

 

 

Add Run As Different User to Windows Explorer Context Menu for Vista and Server 2008

1) After you download ShellRunAs from here, copy it to your WindowsSystem32 folder,

 

2) Open a command line and Runshellrunas /reg

Add Run As Different User to Windows Explorer Context Menu for Vista and Server 2008 :: groovyPost.com

 

3) Click OK to confirm Install completed

Add Run As Different User to Windows Explorer Context Menu for Vista and Server 2008 :: groovyPost.com

 

To test, hold down SHIFT and Right-Click on an application.  You should now see the Run as different user in your context menu.

 

Before:

Add Run As Different User to Windows Explorer Context Menu for Vista and Server 2008 :: groovyPost.com

 

After:

Add Run As Different User to Windows Explorer Context Menu for Vista and Server 2008 :: groovyPost.com