Skip to content

Posts tagged ‘error’

23
Jan

Copying the Contents of Windows Dialogs

As a developer, I very often see error messages – some of those originate from the products I develop, and I have to report them as bugs. Whenever I get an error message in a dialog, I typically take a screenshot, and add that to the bug base issue. That’s fine, but it means people can’t search for that error message in the bug base – in order to enable that, I’d usually just manually type out the error message, rather than take a screenshot. That was before. Today, I’d just press CTRL+C to copy the error dialog contents.

That’s right, whenever you see a dialog in Windows, like this:

A typical Windows error message dialog.

You can press CTRL+C to copy, and then open up Notepad, and press CTRL+V to paste:

The dialog title, contents, and even the button text are saved to the clipboard.

I had no idea this was possible until I read a Lifehacker article explaining it.  Since I’ve started using it, I’ve found it very useful in my every day work. Maybe you will too!

Just a note, though – it doesn’t seem to work everywhere. For example, JavaScript alert dialogs can’t be copied in Firefox, but they can in Internet Explorer.

12
Jun

File Locking: Access Is Denied? Not Anymore.

I’m sure most of you have encountered this type of error, at one time or another, while using Windows:

The "Error Deleting File or Folder" dialog shown when you attempt to delete a file that is in use.

Cannot delete file: Access is denied.

It appears when you try to delete a file or folder that is currently in use by an application. To be completely accurate, the file needs to be in use and locked by the application to prevent external edits – the lock is likely the reason we see the error message. Sometimes it is really obvious which application has a locked handle on the file – for example, if it is complaining about a Word document – perhaps the document is still open in Word. Personally, I consider scenarios like that acceptable because they can be solved easily; unfortunately, all too often I get into trickier situations where I can’t figure out which application is holding onto my file. In those cases, I used to just reboot, and that would usually solve the problem. Yet, there were still cases where rebooting didn’t even do the trick.

Eventually, I was tired of struggling in those moments, and began searching for an application that could help – that’s when I found Unlocker. It allows you to remove locks from individual files via an “Unlocker” option within the Windows context menu. Definitely a nice feature… but listen to this – they took it a step further via  a system tray program called Unlocker Assistant. If you encounter the “Access is denied” error while Assistant is loaded, Unlocker will automatically pop up a few seconds after you click “OK”, and it will show you the culprits:

Unlocker Assistant showing the processes that have a hold on the locked file.

From their interface, you have the option of either killing the process, or unlocking the files themselves – effectively breaking the hold the application has on the file without having to terminate it. Very handy. You can download Unlocker here.

If you’re more inclined to trust Microsoft-sanctioned applications, grab Process Explorer – a Sysinternals app. I didn’t try it for this purpose specifically, but from what I’ve read, it isn’t as simple as Unlocker when it comes to removing the “Access is Denied” error specifically. It serves multiple purposes, whereas Unlocker is specialized.