Below is a sample output from the code above. There are two Windows shortcuts to cmd.exe included in the output, which did not cause any problems. It kind of looks like you were trying to parse through the folder that holds the "Favorites" from Internet Explorer. I tested the script above against the Favorites folder on my system and I didn't encounter any issues.