Thursday, July 21, 2011

I’ve used the wrong tool, now I’ve got to clean up my mess: How I deleted Vista / Windows 7 default shortcuts and got them back again

I’ve used CleanUp! 4.5.2 for a long time for purging temporary folders, especially before rescanning for malware or defragging a disk.  It’s worked very well for me on XP and Windows 2000 computers.  It cleans up browser cache folders and Temp folders for all users and it even makes an amusing flushing sound as you run it (optional).

It doesn’t work so happily on Vista or Windows 7.

Now I should say that CleanUp! 4.5.2 doesn’t say it supports any operating system past XP and it does warn “it is strongly recommended that you first run it in the new demo mode and verify the files that would be deleted before you first run it for real.”

I didn’t use the demo mode.  I got so used to it working so nicely in XP that I didn’t think about it.  Mea culpe.  (That’s how the ancient Romans used to say “my bad”.)

In Vista and Windows 7, CleanUp! ends up deleting the default shortcuts that you see in your Start Menu / All Programs.  Not nice.

These shortcuts in XP would be stored in C:\Documents and Settings\<User>\Start Menu and C:\Documents and Settings\All Users\Start Menu.

In Vista and Windows 7 you can find them in C:\Users\<User>\AppData\Roaming\Microsoft\Windows\Start Menu and for All Users in C:\ProgramData\Microsoft\Windows\Start Menu.

Ok, so you know where they are supposed to go but how do you get them back?

Some very nice folks explain “How to Restore Missing Default Start Menu Shortcuts” and even provide a zipped package of shortcuts belonging to the Current User and All Users for the various editions of Vista and Windows 7.

That’s great.  The links in the zipped files are correct and safe and just what you want but when you extract them to the correct folder and try to use them you get “Open File – Security Warning” each time.  That’s very annoying.  If you check their Properties you’ll see “This file came from another computer and might be blocked to help protect this computer”.  Look, there’s a handy Unblock button that eliminates this security warning.  Now do we have to do this over and over again for each individual file?

Fortunately the answer is no.  I got the solution and some discussion from this page and this page.  They both suggest downloading the Streams CLI executable from Microsoft’s Windows Sysinternals pages.  From a command line, type “streams -s –d” followed by the name of the file or directory you want to fix.

The reason you have to Unblock the files is that when they are downloaded to an NTFS file system a small Alternate Data Stream (ADS) is added to say they might be unsafe to run.  Running “streams –d” deletes that data stream which turns off the warning.

Some of the discussion on the second page mentioned above talks about the potential dangers of deleting Alternate Data Streams, but apparently downloading a file strips it of any streams it has and just adds the “:Zone.Identifier:$DATA” unsafe to run warning as the only stream.  It should be safe to delete the streams of any downloaded file.  Just be careful around other files sitting on your NTFS drive.  You can use AlternateStreamView from Nirsoft to view streams and delete them specifically.

(Because ADS is a function of NTFS, you could also copy the files to a FAT formatted flash drive and back again and they should be unblocked.)

For more information check out the “About Alternate Streams in NTFS File System” section of the AlternateStreamView page.

NirSoft has many other really cool utilities that you should check out.  I especially like CurrPorts: TCP/IP Connections Viewer, ShellExView, BlueScreenView and WirelessKeyView.  Be advised that while I’ve found NirSoft to be reputable and their tools to be safe, some anti-virus programs flag their password recovery utilities as Potentially Unwanted Programs or Hacktools.  Don’t worry.  They could be used for nefarious purposes but there is nothing wrong with them in and of themselves.

If you want to learn more about Alternate Data Streams, you can check out the Practical Guide to Alternative Data Streams in NTFS as a primer or to read about the security risk in ADS check out Symantec’s Windows NTFS Alternate Data Streams.

If you have any suggestions for a really good temp file clean up utilities that work in newer versions of Windows, please let me know.  The classic is CCleaner but I wish I could more easily turn off wiping Most Recently Used (MRU) entries from the default settings when I install it on a client’s machine.  TFC - Temp File Cleaner by OldTimer is simple and effective but it can’t be used remotely because it kills the remote access process and then when it’s done it waits for user input before rebooting.

Wednesday, July 20, 2011

Sometimes correct isn’t good enough: Trouble sending email from Mac OS X Mail

So I’m troubleshooting a problem sending email in the OS X “Snow Leopard” Mail program.  The settings are correct: the SMTP server’s name is right, “Use default ports” is selected, SSL is turned off and Authentication is set to None.  However, every time I try to send the email I get an error “"Cannot send message using the server <server name>”.

I run the Connection Doctor with “Show Detail” selected and see references to ports 587 and 110 but no mention of the default outgoing message SMTP port 25.  Suspicious, I end up going back to Edit SMTP Server List and choose “Use custom port” and enter 25.  What do you know, the outgoing message goes through as happy as can be.

I tested this on another machine with the same problem and again sending worked properly after I set the custom port to 25.  Interestingly, it continued to work after I switched it back again to “Use default ports”.

This is the third particularly noteworthy time I’ve experienced a case where apparently correct settings simply fail to work.  On a Windows 2000 Server I was sharing a folder to the network and made sure the sharing and NTFS permissions were correct.  It just wouldn’t share.  I ended up resetting the share and NTFS permissions and then set them up again exactly the same way as I had originally but this time it worked like a charm.

More recently I was configuring port forwarding on a Linksys router for a Remote Desktop Connection.  The incoming port was correct and the workstation’s static IP address was right.  I could connect from the LAN but not through the router.  I ended up changing the IP address for an existing custom RDC port forward to direct it to the new machine (and set the listening port to match) and it worked perfectly.  Both forwards should have worked but only one did.

This is along the same lines as other situations I’ve experienced where some program option is correct but it’s not working.  Change the option to something wrong and then switch it back to the correct setting and it works.  What’s different?  Apparently nothing, but something changed “under the hood”.  The original setting had not registered properly but changing it and changing it back made the difference.

Sometimes computers aren’t logical, at least not at the user interface level.

Friday, July 15, 2011

Internet Explorer 10 Platform Preview 2 and Page Visibility

The Internet Explorer 10 Platform Preview 2 caught my eye today.  Since I’ve found that IE 9 is a significant improvement on IE 8 for those machines that have the hardware to run it properly, I was curious to see what was new in IE 10.

While there are some page layout features that are going to make life much easier for webmasters, the things that interested me most were the Web Workers and Page Visibility components.

The Web Workers feature breaks off CPU intensive JavaScript code and runs it separately in the background so as to avoid hanging the page itself and to allow the JavaScript to run multi-threaded and so make use of the power of multi-core processors.

I like Page Visibility even more for my own special reasons.  For the first time the browser can keep track of whether you can actually see a given page and so the pages can be coded so they don’t waste computing power being active when you’re not actually looking at them.  When the browser window is minimized the page knows that it is hidden and can take a breather.  Hopefully this is true when you select another tab in the same window.  I expect so but I can’t test it because the Platform Preview only displays one page.

Why am I so interested in Page Visibility?  My last computer had a Pentium 4 1.8 GHz processor and 512 MB of RAM.  Fielding tech support calls from various clients in a day, I found myself opening an increasing number of windows and tabs in Firefox.  I’d open at least one window per client and 5 to 15 tabs and then leave them open until I had time to bookmark the best pages.  This brought my system to its knees.  I added an extra gigabyte of RAM and that helped some but all those tabs would run up my CPU usage towards 100% as all those pages animated or updated or whatever they were doing in the background.

My current computer has a quad-core 2.8 GHz processor and 8 GB of RAM and so far handles my web abuse quite well.  However, given my recent personal best 32 windows including 286 tabs, the overall CPU usage often exceeds 50, 60 and sometimes 70%.  My system is still quite responsive but it sucks power and spits out heat.  In the summer without air conditioning I can feel it warm up the room.

With Page Visibility I could keep open an insane number of tabs and have them resting comfortably when I’m not looking at them.  And that will keep me resting (read “slaving away) comfortably as well.

If you are intereted in reading more about IE 10 PP 2 here are a couple of reviews I found interesting:

Internet Explorer 10 Platform Preview 2 shows strong progress
Internet Explorer 10 Platform Preview 2 is to die for

Sunday, July 10, 2011

Recover iTunes Library From an iPod, Especially an iPod Touch

Scenario: Your hard drive fails and you replace it but you have no backup of your iTunes library and playlists except on your iPod.

First, don’t let iTunes sync an empty library to your full iPod.  Disable iTunes automatic sync.  It warned me before trying to sync but I’m not sure if it always does that.

Next, retrieve the contents of the iPod.

You used to be able to use PodLift to quickly dump the iPod’s contents to your computer but it doesn’t work on newer iPods and the author is no longer developing the program.

If your iPod can show up as a removable drive in Windows Explorer (you may have to enable this option in iTunes) you can restore your library manually.  Here’s a nice summary of the procedure.

The process isn’t trivial but isn’t too bad once you’ve managed to convince Windows to show hidden files and folders.  From that point you just look in the iPod’s hidden iPod_Control folder and the likewise hidden Music sub-folder.  Within that you will find not very descriptive folder names containing MP3s and whatnot with not very descriptive file names.

At this point you can copy the music to your hard drive or get ready to import it directly into iTunes.  I like the idea of having a spare copy in case something messes up or you accidentally sync the empty library and wipe the iPod.

Even though you can see the music files in Explorer, you may have to unhide the music files so iTunes can see them.  Just select everything, right-click, and change the Properties so they are not Hidden.

Make sure iTunes is set to manage your music files and to copy them into its iTunes Music folder hierarchy.  Then import all the music.  iTunes will copy the music files into artist and album folders and rename the files themselves according to their metadata such as ID3 tags.

Recovering an iPod touch presents a roadblock for this procedure in that it will show up in My Computer but it won’t show up as a removable drive.  You can’t get at the hidden folders.

Enter GizmoRip.  It picks up where PodLift left off.  It can access the contents of an iPod Touch plus it has features to let you recover playlists and metadata, copy the music files or just import them directly into iTunes.  It also has a feature to rip pictures from your iPod.

I had trouble downloading from the http://www.gizmorip.com/ web site but you can also get it from Download.com.

Why does Apple make it so hard to recovery your music from your iPod?  Speculation is that it’s to appease the music rights holders who fear that you might suck the entire music library off of every iPod you can borrow.  This is especially true now that iTunes and others have abandoned restricting playback to only authorized media devices.

I don’t know if this is their actual motivation but they seem to persist in changing iPods to ensure difficulty in offloading music.

I do know that this is one of the reasons that I listen to my music from my BlackBerry and don’t feel the urge to buy an iPhone.  In the BlackBerry the memory card has a straight up standard file system.  I can easily recover the contents if needed and I can sync it with whatever program I choose or just copy the music manually using Windows Explorer.

Removing Duplicate Files

As a follow on to my previous post about the Link Shell Extension software and hard links, I thought I’d say something about finding and removing duplicate files especially now that I’ve found a free program that can turn duplicates into hard links.

I had been using Easy Duplicate Finder version 2.2.4 and was fairly pleased with it.  It finds duplicates based on parameters such as name and file size as well as content (based on a byte to byte comparison or a hash of the whole file) and had a good selection assistance feature.

However, it seems any version of Easy Duplicate Finder above 2.4 is no longer free, so when I started having a few crashes with it I went looking for an alternative free duplicate finder.

My favourite resource for finding new freeware is Gizmo's Freeware.  They have volunteer editors who review freeware in different categories, explain the differences and give their recommendations.  Their Best Free Duplicate File Detector page led me to try Duplicate Cleaner.

I’m quite pleased with Duplicate Cleaner.  In addition to having all the features of Easy Duplicate Finder, it has a better Selection Assistant and a variety of File Removal options that include Delete, Delete to Recycle Bin, Move, Copy, Rename and of course the aforementioned Create Hardlinks.

I use hard links when I’ve been sorting things like pictures to upload somewhere and really just want to keep the selection for reference and don’t need a spare copy of the photos.  I use Link Shell Extension now for making hard linked copies of my pictures without taking up any more disk space but for those selections I’ve made before I can clean them up with Duplicate Cleaner’s Create Hardlinks options.

The Create Hardlinks is a very safe option in that you can’t accidentally delete something with it.  It will only make a hard link to identical file contents and the only thing removed is the second copy of that identical data.  The duplicate file is still there but under the hood it only points to the original copy of the file.  However, if the original is ever deleted then the duplicate becomes the sole and complete copy of the file.

Most people are just going to use Duplicate Cleaner for actually deleting duplicates and I’d use it for that even if it didn’t have the extra hard links feature.  I really like the options to select from a list of duplicates using “Select by Location” where it keeps the files from one specific folder path and “Select by text pattern” where I can Mark or Unmark based on any string of text in the file name.

The text pattern has a Column Name drop down box where you can switch to searching for path, creation date, image size, bit rate and a variety of other fields that you would see if you right clicked the file, clicked Properties and chose the Details tab.

The beautiful thing is that you can mark or unmark to augment your original selection criteria.  It doesn’t wipe your existing selections and go only by the text pattern.

Be aware when running the Duplicate Cleaner installer that there is optional sponsor software (currently Bing Toolbar) that you can uncheck if you don’t want it included.