<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" media="screen" href="/styles/xslt/rss.xslt"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:c9="http://channel9.msdn.com">
<channel>
	<title>Channel 9 Forums - Coffeehouse - Win7 deletes shortcuts on the desktop</title>
	<atom:link rel="self" type="application/rss+xml" href="http://channel9.msdn.com/Forums/rss"></atom:link>
	<image>
		<url>http://mschnlnine.vo.llnwd.net/d1/Dev/App_Themes/C9/images/feedimage.png</url>
		<title>Channel 9 Forums - Coffeehouse - Win7 deletes shortcuts on the desktop</title>
		<link>http://channel9.msdn.com/Forums</link>
	</image>
	<description>Channel 9 keeps you up to date with the latest news and behind the scenes info from Microsoft that developers love to keep up with. From LINQ to SilverLight – Watch videos and hear about all the cool technologies coming and the people behind them.</description>
	<link>http://channel9.msdn.com/Forums</link>
	<language>en</language>
	<pubDate>Thu, 20 Jun 2013 06:06:46 GMT</pubDate>
	<lastBuildDate>Thu, 20 Jun 2013 06:06:46 GMT</lastBuildDate>
	<generator>Rev9</generator>
	<c9:totalResults>21</c9:totalResults>
	<c9:pageCount>-21</c9:pageCount>
	<c9:pageSize>-1</c9:pageSize>
	<item>
		<title>Coffeehouse - Win7 deletes shortcuts on the desktop</title>
		<description><![CDATA[<p>Windows 7 deletes shortcuts from your desktop if they point on files that no longer exist. It doesn't prompt you to clean up the desktop like XP did, it just deletes them. It doesn't even put them in the recycle bin, FFS. </p><p>Seriously, who thought this was a good idea?</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop/1687079ab161408c8069a00b00b85acb#1687079ab161408c8069a00b00b85acb</link>
		<pubDate>Mon, 05 Mar 2012 11:11:12 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop/1687079ab161408c8069a00b00b85acb#1687079ab161408c8069a00b00b85acb</guid>
		<dc:creator>rhm</dc:creator>
		<slash:comments>21</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/rhm/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Win7 deletes shortcuts on the desktop</title>
		<description><![CDATA[<p>If they point to a file that no longer exists, why would Windows keep them?</p><p>Analogy: I delete a music folder off my music share, MediaMonkey sees that and takes the album out of my library. I wouldn't see a reason for a prompt, and they didn't put one in.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop/39e26fe9ec7049e194b0a00b00f920b1#39e26fe9ec7049e194b0a00b00f920b1</link>
		<pubDate>Mon, 05 Mar 2012 15:07:02 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop/39e26fe9ec7049e194b0a00b00f920b1#39e26fe9ec7049e194b0a00b00f920b1</guid>
		<dc:creator>Harlequin</dc:creator>
		<slash:comments>21</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Harlequin/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Win7 deletes shortcuts on the desktop</title>
		<description><![CDATA[<p>@<a href="/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop#c39e26fe9ec7049e194b0a00b00f920b1">Harlequin</a>: The problem usually occurs when they're pointing at a location which might be temporarily unavailable, such as a network drive.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop/3ac54c22b3b44646bde4a00b00fe28d3#3ac54c22b3b44646bde4a00b00fe28d3</link>
		<pubDate>Mon, 05 Mar 2012 15:25:21 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop/3ac54c22b3b44646bde4a00b00fe28d3#3ac54c22b3b44646bde4a00b00fe28d3</guid>
		<dc:creator>AndyC</dc:creator>
		<slash:comments>21</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/AndyC/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Win7 deletes shortcuts on the desktop</title>
		<description><![CDATA[<p>Or in my case, they point to build targets that might not have been produced due to compile errors.</p><p>It's another case of Windows trying to be clever and do stuff automatically when there is no automatic action that makes sense for every scenario.</p><p>And even if you want to argue that it's acceptable to delete broken shortcuts without prompting the user because that's the right thing to do 99% of the time, why in the name of great suffing **** does it not put them in the recycle bin? Who is that helping? The PM who came up with this is a complete jackass.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop/1229662f890142169519a00b0101c1e1#1229662f890142169519a00b0101c1e1</link>
		<pubDate>Mon, 05 Mar 2012 15:38:27 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop/1229662f890142169519a00b0101c1e1#1229662f890142169519a00b0101c1e1</guid>
		<dc:creator>rhm</dc:creator>
		<slash:comments>21</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/rhm/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Win7 deletes shortcuts on the desktop</title>
		<description><![CDATA[<p>It seems like you're doing stuff the wrong way round.</p><p>Instead of having shortcuts to files that might not exist yet, why not create the shortcuts when you create the files as part of the build/batch process?</p><p>The reason the file doesn't go to the recycle bin is because it's easier to delete a file with DeleteFile than it is to use COM to move it to the recycle bin. This is an example of &quot;that feature isn't there because someone would have to program it&quot;, and anyone who thought that deleting the shortcut might need to be an undoable action would probably not delete the shortcut without a prompt.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop/a9a7fefa7e8e4299824da00b012a865e#a9a7fefa7e8e4299824da00b012a865e</link>
		<pubDate>Mon, 05 Mar 2012 18:06:53 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop/a9a7fefa7e8e4299824da00b012a865e#a9a7fefa7e8e4299824da00b012a865e</guid>
		<dc:creator>evildictaitor</dc:creator>
		<slash:comments>21</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/evildictaitor/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Win7 deletes shortcuts on the desktop</title>
		<description><![CDATA[<p>You need to think of the scope of this. You could have an Excel file with 130 shortcuts to it, in multiple folders. You delete the Excel file...now what. Should the system &quot;know&quot; all shortcuts that pointed to the file? Should those all end up in the recycle bin if it does.</p><p><strong>Experiment:</strong></p><p>Make a temp file.<br>Put a shortcut to it on the desktop.<br>Put a shortcut to it somewhere else. E.g. the root of your D: drive.<br>Delete temp&nbsp;file.<br>What happens? Do all shortcuts disappear? Does only the desktop one get wiped? Does the desktop one get wiped and the other ends up in the recycle bin? Etc.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop/9f5fb02ce02649b781eea00b0131e575#9f5fb02ce02649b781eea00b0131e575</link>
		<pubDate>Mon, 05 Mar 2012 18:33:44 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop/9f5fb02ce02649b781eea00b0131e575#9f5fb02ce02649b781eea00b0131e575</guid>
		<dc:creator>Harlequin</dc:creator>
		<slash:comments>21</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Harlequin/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Win7 deletes shortcuts on the desktop</title>
		<description><![CDATA[<p>I don't know where to start about an operating system deleting anything belonging to the user&nbsp;without knowing why it is there. As AndyC alluded to, there might be shortcuts on the desktop to network locations which may be temporarily unavailable. Notebook users who may not be on the network for days at a time is the most glaring example. And no, the user isn't &quot;doing it wrong.&quot;</p><p>Anyway, this happens as part of Windows 7's system maintenance which is controlled by a number of a Powershell scripts in %systemroot%\diagnostics\scheduled\Maintenance. Commenting out lines 28-36 in TS_BrokenShortcuts.ps1 will prevent it from being able to do this (it will cause the script to act on an empty list basically). You&nbsp;need to take ownership of the file first, then add permission to edit the file. Be sure to reverse the permissions change and make the owner TrustedInstaller again when done.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop/e793d48ba187482688c2a00c0026ac0e#e793d48ba187482688c2a00c0026ac0e</link>
		<pubDate>Tue, 06 Mar 2012 02:20:48 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop/e793d48ba187482688c2a00c0026ac0e#e793d48ba187482688c2a00c0026ac0e</guid>
		<dc:creator>Craig Matthews</dc:creator>
		<slash:comments>21</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Craig_Matthews/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Win7 deletes shortcuts on the desktop</title>
		<description><![CDATA[<p>@<a href="/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop#ce793d48ba187482688c2a00c0026ac0e">Craig_Matthews</a>: Windows won't delete a shortcut to the network just because the network is unavailable. It will delete it if the network is available and the file isn't.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop/97fdcdd20bd942a7bc6aa00c00afebf5#97fdcdd20bd942a7bc6aa00c00afebf5</link>
		<pubDate>Tue, 06 Mar 2012 10:40:30 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop/97fdcdd20bd942a7bc6aa00c00afebf5#97fdcdd20bd942a7bc6aa00c00afebf5</guid>
		<dc:creator>evildictaitor</dc:creator>
		<slash:comments>21</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/evildictaitor/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Win7 deletes shortcuts on the desktop</title>
		<description><![CDATA[<p>I worked from home one day last week (an unusual event for me at the moment) connecting to work through a VPN. I created a desktop shortcut to an application on the server.</p><p>After several restarts and log-on/off cycles the desktop shortcut was still there (without me having reconnected to the VPN). I eventually deleted the shortcut manually.</p><p>So, as evildictaitor said, it looks like Win7 is smart enough to keep shortcuts to networked resources.</p><p>Herbie</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop/b5ef575bc4144e028a8ca00c00c9e6a2#b5ef575bc4144e028a8ca00c00c9e6a2</link>
		<pubDate>Tue, 06 Mar 2012 12:15:05 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop/b5ef575bc4144e028a8ca00c00c9e6a2#b5ef575bc4144e028a8ca00c00c9e6a2</guid>
		<dc:creator>Herbie Smith</dc:creator>
		<slash:comments>21</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Dr Herbie/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Win7 deletes shortcuts on the desktop</title>
		<description><![CDATA[<p>@<a href="/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop#c97fdcdd20bd942a7bc6aa00c00afebf5">evildictaitor</a>: Leaving aside the almost inevitable race conditions in determining that, it's still deleting files based on some external factor that is out of the control of the OS. What if the file on the server has been momentarily deleted with the intention of putting a replacement in? Or if there is some temporary issue that makes the file appear to have been deleted?</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop/0409b5f14bc14c62b0dfa00c00cb18b8#0409b5f14bc14c62b0dfa00c00cb18b8</link>
		<pubDate>Tue, 06 Mar 2012 12:19:27 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop/0409b5f14bc14c62b0dfa00c00cb18b8#0409b5f14bc14c62b0dfa00c00cb18b8</guid>
		<dc:creator>AndyC</dc:creator>
		<slash:comments>21</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/AndyC/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Win7 deletes shortcuts on the desktop</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop/0409b5f14bc14c62b0dfa00c00cb18b8">46 minutes&nbsp;ago</a>, <a href="/Niners/AndyC">AndyC</a> wrote</p><p>@<a href="/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop#c97fdcdd20bd942a7bc6aa00c00afebf5">evildictaitor</a>: Leaving aside the almost inevitable race conditions in determining that, it's still deleting files based on some external factor that is out of the control of the OS. What if the file on the server has been momentarily deleted with the intention of putting a replacement in? Or if there is some temporary issue that makes the file appear to have been deleted?</p><p></p></div></blockquote><p></p><p>There's no race-condition here. If the file exists the shortcut stays. If it doesn't it goes. If the file appears slightly after the shortcut went away, well the shortcut wasn't pointing to something so it deserved to die. If the file disappeared after choosing to keep the shortcut, well you're no better off than before where the shortcut points into the ether.</p><p>Look, I'm not saying deleting shortcuts without a prompt is a good idea - I'm just saying that it's a valid action for the OS to take. The sole purpose of a shortcut is to take you to a target file. If that file isn't there then the only purpose of the shortcut has vanished, and hence leaving the shortcut around clutters up the folder. The reason will be that uninstalling programs often doesn't delete the shortcut files they inevitably dropped on the desktop during install, and this was an attempt to stop your desktop becoming a shortcut&nbsp;cemetery.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop/cd43040146264aa28731a00c00d8ff81#cd43040146264aa28731a00c00d8ff81</link>
		<pubDate>Tue, 06 Mar 2012 13:10:03 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop/cd43040146264aa28731a00c00d8ff81#cd43040146264aa28731a00c00d8ff81</guid>
		<dc:creator>evildictaitor</dc:creator>
		<slash:comments>21</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/evildictaitor/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Win7 deletes shortcuts on the desktop</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop/cd43040146264aa28731a00c00d8ff81">4 hours&nbsp;ago</a>, <a href="/Niners/evildictaitor">evildictaitor</a> wrote</p><p>Look, I'm not saying deleting shortcuts without a prompt is a good idea - I'm just saying that it's a valid action for the OS to take. The sole purpose of a shortcut is to take you to a target file. If that file isn't there then the only purpose of the shortcut has vanished, and hence leaving the shortcut around clutters up the folder. The reason will be that uninstalling programs often doesn't delete the shortcut files they inevitably dropped on the desktop during install, and this was an attempt to stop your desktop becoming a shortcut&nbsp;cemetery.</p><p></p></div></blockquote><p></p><p>And what about the effort I put into manually changing parameters to run my program? That's why I have all these shortcuts.</p><p>So, deleting shortcuts to clean up after broken uninstallers is a 'valid action'. But that's not the only reason people have shortcuts on their desktop. Windows has just added more idiocy to fight idiocy and broken the general case: That the OS shouldn't delete user files without warning.</p><p>@Craig_Mathews Thanks for the tip. I managed to edit the file you mentioned but I couldn't change it's owner back to TrustedInstaller as there is no user called that which is weird.</p><p>@Dr.Herbie&nbsp; This 'clean up'/'balls up' process only runs once a week (01:00 on Sunday night on my machine) - it might not have actually run during your experiment. As far I can tell from the PS script, it doesn't take any account of whether the drive the target is located on it available.</p><p></p><pre class="brush: text"># Function to check whether the shortcut is validfunction Test-ValidLink([Wmi]$wmiLinkFile = $(throw &quot;No WMI link file is specified&quot;)){    if(($wmiLinkFile -eq $null) -or ([String]::IsNullOrEmpty($wmiLinkFile.Target)))    {        return $false    }    return Test-Path $wmiLinkFile.Target}</pre><p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop/3d2ab2e194624b6ca31fa00c012ec259#3d2ab2e194624b6ca31fa00c012ec259</link>
		<pubDate>Tue, 06 Mar 2012 18:22:18 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop/3d2ab2e194624b6ca31fa00c012ec259#3d2ab2e194624b6ca31fa00c012ec259</guid>
		<dc:creator>rhm</dc:creator>
		<slash:comments>21</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/rhm/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Win7 deletes shortcuts on the desktop</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop/cd43040146264aa28731a00c00d8ff81">10 hours&nbsp;ago</a>, <a href="/Niners/evildictaitor">evildictaitor</a> wrote</p><p>*snip*</p><p>There's no race-condition here. If the file exists the shortcut stays. If it doesn't it goes. If the file appears slightly after the shortcut went away, well the shortcut wasn't pointing to something so it deserved to die. If the file disappeared after choosing to keep the shortcut, well you're no better off than before where the shortcut points into the ether.</p><p></p></div></blockquote><p></p><p>You have to take two decisions for network shortcuts, assuming we aren't going to delete them when the network drive isn't available.</p><p>1) Is the network drive available?</p><p>2) Is the target of the shortcut available?</p><p>A race condition is inevitable, since the availability of the network drive between steps 1 and 2 is indeterminate. It's the same anti-pattern that underlies all the IsBadXXXPtr type functions.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop/aa6bcf764ef346a3bec3a00c0181a00e#aa6bcf764ef346a3bec3a00c0181a00e</link>
		<pubDate>Tue, 06 Mar 2012 23:24:01 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop/aa6bcf764ef346a3bec3a00c0181a00e#aa6bcf764ef346a3bec3a00c0181a00e</guid>
		<dc:creator>AndyC</dc:creator>
		<slash:comments>21</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/AndyC/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Win7 deletes shortcuts on the desktop</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop/3d2ab2e194624b6ca31fa00c012ec259">5 hours&nbsp;ago</a>, <a href="/Niners/rhm">rhm</a> wrote</p><p>That the OS shouldn't delete user files without warning.</p><p></p></div></blockquote><p></p><p>Actually what is this all about? I tried this on my desktop and I get a dialog:</p><p></p><blockquote><div class="quoteText"><p></p><p>The item &quot;blag.bmp&quot; that this shortcut refers to has been changed or moved, so this shortcut will no longer work properly.</p><p>Do you want to delete this shortcut?</p><p>[YES] [NO]</p><p></p></div></blockquote><p></p><p>What more do you want Microsoft to do for you? The shortcut doesn't work, they gave you a dialog asking if you wanted to delete the file, you clicked YES and it deleted it.</p><p>EDIT: And if the file is in the recycle bin, Microsoft even give you the option to un-recycle it</p><p>EDIT2: And if your shortcut points somewhere in the same file and that file has been renamed, the shortcut will also update.</p><p>This code is&nbsp;<em>going out of its way</em> to make your life easier, and has no less than three different dialogs to help you out. It's really not the big bad evil Windows that you're making it out to be.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop/bdbeda38a5f6462fa50fa00d0001cfd8#bdbeda38a5f6462fa50fa00d0001cfd8</link>
		<pubDate>Wed, 07 Mar 2012 00:06:35 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop/bdbeda38a5f6462fa50fa00d0001cfd8#bdbeda38a5f6462fa50fa00d0001cfd8</guid>
		<dc:creator>evildictaitor</dc:creator>
		<slash:comments>21</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/evildictaitor/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Win7 deletes shortcuts on the desktop</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop/aa6bcf764ef346a3bec3a00c0181a00e">50 minutes&nbsp;ago</a>, <a href="/Niners/AndyC">AndyC</a> wrote</p><p>*snip*</p><p>You have to take two decisions for network shortcuts, assuming we aren't going to delete them when the network drive isn't available.</p><p>1) Is the network drive available?</p><p>2) Is the target of the shortcut available?</p><p></p></div></blockquote><p></p><p>Those are the same step: Does CreateFile(&quot;\\networkpath\path\foo&quot;) fail with a file not found error code? If yes, then do something different.</p><p></p><blockquote><div class="quoteText"><p></p><p>It's the same anti-pattern that underlies all the IsBadXXXPtr type functions.</p><p></p></div></blockquote><p></p><p>IsBadXXXPtr is a check, not a security check function. It is there to check that your arguments and the integrity of your application are valid, not to protect against malicious threads in your process changing things on the fly - because frankly if there's a malicious thread changing the protection of various bits of memory in your process, you've already long since lost your fight against those hackers.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop/a66444239b924aee9c04a00d0002792a#a66444239b924aee9c04a00d0002792a</link>
		<pubDate>Wed, 07 Mar 2012 00:09:00 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop/a66444239b924aee9c04a00d0002792a#a66444239b924aee9c04a00d0002792a</guid>
		<dc:creator>evildictaitor</dc:creator>
		<slash:comments>21</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/evildictaitor/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Win7 deletes shortcuts on the desktop</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop/bdbeda38a5f6462fa50fa00d0001cfd8">10 minutes&nbsp;ago</a>, <a href="/Niners/evildictaitor">evildictaitor</a> wrote</p><p>*snip*</p><p>Actually what is this all about? I tried this on my desktop and I get a dialog:</p><p>*snip*</p><p>What more do you want Microsoft to do for you? The shortcut doesn't work, they gave you a dialog asking if you wanted to delete the file, you clicked YES and it deleted it.</p><p></p></div></blockquote><p></p><p>The point is this happens as part of a default Scheduled Task, not how the shell handles it if you click an invalid shortcut.</p><p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop/a66444239b924aee9c04a00d0002792a">8 minutes&nbsp;ago</a>, <a href="/Niners/evildictaitor">evildictaitor</a> wrote</p><p>*snip*</p><p>IsBadXXXPtr is not a security function, and hence this is not a real anti-pattern.</p><p></p></div></blockquote><p></p><p>It's not about security. If IsBadXXXPtr fails, the pointer is invalid. If it suceeds, the pointer might still be invalid. So basically making any decision on it is entirely pointless.</p><p>Checking something global&nbsp;exists/is valid then following up by attempting to do something based on the assumption that it is valid is fundamentally flawed on a multitasking OS. The only valid way to do it is to perform the action and respond correctly to a failure, but obviously that's not an option here and as such there is no correct way to write this functionality and it shouldn't exist at all.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop/4283b0a9830d4a18b275a00d00069023#4283b0a9830d4a18b275a00d00069023</link>
		<pubDate>Wed, 07 Mar 2012 00:23:53 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop/4283b0a9830d4a18b275a00d00069023#4283b0a9830d4a18b275a00d00069023</guid>
		<dc:creator>AndyC</dc:creator>
		<slash:comments>21</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/AndyC/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Win7 deletes shortcuts on the desktop</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop/4283b0a9830d4a18b275a00d00069023">2 minutes&nbsp;ago</a>, <a href="/Niners/AndyC">AndyC</a> wrote</p><p>The point is this happens as part of a default Scheduled Task, not how the shell handles it if you click an invalid shortcut.</p><p></p></div></blockquote><p></p><p>In that case, just remove the scheduled task that does this. It's in &quot;C:\Windows\diagnostics\scheduled\Maintenance\TS_BrokenShortcuts.ps1&quot;.</p><p></p><blockquote><div class="quoteText"><p></p><p>It's not about security. If IsBadXXXPtr fails, the pointer is invalid. If it suceeds, the pointer might still be invalid. So basically making any decision on it is entirely pointless.</p><p></p></div></blockquote><p></p><p>On the contrary. If you define a method SetCallbackFunction(void* foo), you probably don't want to create a difficult to debug error where somebody gives you a bad code pointer and then later your program crashes. If instead you call IsBadCodePtr(foo) on the argument, you'll see the bad argument as it comes into your function instead of having to make guesses at who called SetCallbackFunction last.</p><p></p><blockquote><div class="quoteText"><p></p><p>Checking something global&nbsp;exists/is valid then following up by attempting to do something based on the assumption that it is valid is fundamentally flawed on a multitasking OS. The only valid way to do it is to perform the action and respond correctly to a failure, but obviously that's not an option here and as such there is no correct way to write this functionality and it shouldn't exist at all.</p><p></p></div></blockquote><p></p><p></p><pre class="brush: text">lock(object){   if(object.IsValid)   {      object.DoSomething();   }} </pre><p></p><p>Is entirely valid despite running on a multitasking OS - and is even valid if there is network traffic involved so long as the lock is a lock that is honoured by the client and the server. A case in point is SQL - because of transactions you are able to make a decision based on data in the SQL database and then update something else all atomically, despite the fact that there's a &quot;race-condition&quot; and network traffic involved</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop/eccee7cae0614ff89e12a00d0008f56f#eccee7cae0614ff89e12a00d0008f56f</link>
		<pubDate>Wed, 07 Mar 2012 00:32:37 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop/eccee7cae0614ff89e12a00d0008f56f#eccee7cae0614ff89e12a00d0008f56f</guid>
		<dc:creator>evildictaitor</dc:creator>
		<slash:comments>21</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/evildictaitor/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Win7 deletes shortcuts on the desktop</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop/eccee7cae0614ff89e12a00d0008f56f">4 minutes&nbsp;ago</a>, <a href="/Niners/evildictaitor">evildictaitor</a> wrote</p><p>*snip*</p><p>In that case, just remove the scheduled task that does this. It's in &quot;C:\Windows\diagnostics\scheduled\Maintenance\TS_BrokenShortcuts.ps1&quot;.</p><p></p></div></blockquote><p></p><p>I don't think users should be expected to hack about inside OS defined scripts to get decent behaviour.</p><p></p><blockquote><div class="quoteText"><p></p><p>*snip*</p><p>On the contrary. If you define a method SetCallbackFunction(void* foo), you probably don't want to create a difficult to debug error where somebody gives you a bad code pointer and then later your program crashes. If instead you call IsBadCodePtr(foo) on the argument, you'll see the bad argument as it comes into your function instead of having to make guesses at who called SetCallbackFunction last.</p><p></p></div></blockquote><p></p><p>Except you don't know if it's valid or invalid. The most IsBadXXXPtr can possibly tell you is that it was valid/invalid at some arbitrary point in the past. So absolutely any code which ever uses foo still has to call it defensively and handle the situation in which it was a bad pointer. Thus making the IsBadXXXPtr call entirely redundant.</p><p></p><blockquote><div class="quoteText"><p></p><p>*snip*</p><div class="syntaxhighlighterHolder"><div id="highlighter_169594" class="syntaxhighlighter text ie"><table border="0" cellspacing="0" cellpadding="0"><tbody><tr><td class="gutter"><div class="line number1 index0 alt2">1</div></td><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="text plain">lock(object){&nbsp;&nbsp; if(object.IsValid)&nbsp;&nbsp; {&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; object.DoSomething();&nbsp;&nbsp; }}</code></div></div></td></tr></tbody></table></div></div><p>Is entirely valid despite running on a multitasking OS - and is even valid if there is network traffic involved so long as the lock is a lock that is honoured by the client and the server.</p><p></p></div></blockquote><p></p><p>If you can hold a lock on something, then it's no longer entirely out of your control, so that's fine (just as a similar pattern on entirely private objects is). Getting a lock on something that doesn't exist (or at best whose existance is indeterminate) doesn't work though and hence we find ourselves back at the IsBadXXXPtr anti-pattern.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop/03ea176b353f42a09b67a00d000c47a8#03ea176b353f42a09b67a00d000c47a8</link>
		<pubDate>Wed, 07 Mar 2012 00:44:42 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop/03ea176b353f42a09b67a00d000c47a8#03ea176b353f42a09b67a00d000c47a8</guid>
		<dc:creator>AndyC</dc:creator>
		<slash:comments>21</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/AndyC/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Win7 deletes shortcuts on the desktop</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop/03ea176b353f42a09b67a00d000c47a8">1 minute&nbsp;ago</a>, <a href="/Niners/AndyC">AndyC</a> wrote</p><p>I don't think users should be expected to hack about inside OS defined scripts to get decent behaviour.</p><p></p></div></blockquote><p></p><p>I've never come across this being a problem before. If you feel strongly about, file a bug.</p><p></p><blockquote><div class="quoteText"><p></p><p>The most IsBadXXXPtr can possibly tell you is that it was valid/invalid at some arbitrary point in the past.So absolutely any code which ever uses foo still has to call it defensively and handle the situation in which it was a bad pointer. Thus making the IsBadXXXPtr call entirely redundant.</p><p></p></div></blockquote><p></p><p>Knowing that it used to be valid is still better than nothing. And any code which calls foo doesn't have to code defensively if the contract is anyone who calls SetCallbackFunction() must set a valid function (an example of this is the SetUnhandledExceptionCallback function). If that function used to be valid but no longer is, well all bets are off - the guy who unloaded the function could just have easilly unloaded all of the exectauble code in the process and then you'd definitely crash.</p><p>If you're trying to prevent people who can run arbitrary code in your process from being able to crash it, you're going to lose, and the IsBadXXXPtr isn't going to help you. If you want to put in debug assertions to help catch errors in development (which might be your or other people's code) then this is an entirely valid programming style.</p><p></p><blockquote><div class="quoteText"><p></p><p>If you can hold a lock on something, then it's no longer entirely out of your control, so that's fine (just as a similar pattern on entirely private objects is). Getting a lock on something that doesn't exist (or at best whose existance is indeterminate) doesn't work though and hence we find ourselves back at the IsBadXXXPtr anti-pattern.</p><p></p></div></blockquote><p></p><p>You never get a lock on something that might not exist. You get a lock on the&nbsp;<em>container&nbsp;</em>of the object, and then you query for the object. The same is true in SMB/webdav.</p><p>1) Get a connection to the share (if that fails, fail with a NO_NETWORK error)</p><p>2) Traverse as far as you can down the folder heirarchy. If you fail, return a FILE_NOT_THERE error.</p><p>3) Lock the folder. If this fails, return a LOCK_FAILED error</p><p>4) Query for the file. If this fails, unlock and return a FILE_NOT_THERE error.</p><p>5) Do something with the file. The file will be there because you have a lock on it, and when you're done release the lock.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop/f9bdb09052524bfba417a00d000ecc7a#f9bdb09052524bfba417a00d000ecc7a</link>
		<pubDate>Wed, 07 Mar 2012 00:53:52 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop/f9bdb09052524bfba417a00d000ecc7a#f9bdb09052524bfba417a00d000ecc7a</guid>
		<dc:creator>evildictaitor</dc:creator>
		<slash:comments>21</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/evildictaitor/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Win7 deletes shortcuts on the desktop</title>
		<description><![CDATA[<p>@rhm:</p><p>Try putting the user NT SERVICE\TrustedInstaller in the dialog. That should change it back.</p><p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop/b5ef575bc4144e028a8ca00c00c9e6a2">12 hours&nbsp;ago</a>, <a href="/Niners/Dr%20Herbie">Dr&nbsp;Herbie</a> wrote</p><p>I worked from home one day last week (an unusual event for me at the moment) connecting to work through a VPN. I created a desktop shortcut to an application on the server.</p><p>After several restarts and log-on/off cycles the desktop shortcut was still there (without me having reconnected to the VPN). I eventually deleted the shortcut manually.</p><p>So, as evildictaitor said, it looks like Win7 is smart enough to keep shortcuts to networked resources.</p><p>Herbie</p><p></p></div></blockquote><p></p><p><a href="http://support.microsoft.com/kb/978980">http://support.microsoft.com/kb/978980</a></p><p>It's not something&nbsp;that happens&nbsp;immediately. It occurs as part of a scheduled&nbsp;weekly maintenance task.&nbsp;If there are more than four broken shortcuts on the desktop (it does not matter what the target is -- local file, local folder, UNC path, whatever), the scheduled task deletes them.</p><p>So when the CFO, with shortcuts to network locations (crystal reports folder, budget spreadsheets, department specific budget folders, whatever), goes on vacation and takes her laptop with her, she will come back to work, try to open the shortcut to a document, notice that the shortcut is gone, and have to find the target, wherever it is, on a network with tens or hundreds of file shares. For all 5&#43; of these locations.</p><p>@evildictaitor:</p><p>Deleting shortcuts should not be default behavior by a background maintenance task that requires manual deskside intervention by a system administrator to turn off.</p><p>And believe it or not, lots of business applications are both <em>live and run</em> from network locations.&nbsp;The CFO above would be mighty&nbsp;pissed if she&nbsp;can't find the shortcut to the fixed asset application that she needs to run after coming back from vacation.</p><p>You may not think there is a valid reason for shortcut targets to be temporarily unavailable (even if temporarily is 8 days or more), but that's simply not reality.</p><p>&nbsp;Edit to add:</p><p>In Before &quot;Shortcuts to network locations&quot; and/or &quot;vacations&quot; are labeled as &quot;corner cases&quot; or &quot;power user&quot; (with 'power user' being defined as 'computer geek') features.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop/c1070bba338146b69a14a00d00167bc3#c1070bba338146b69a14a00d00167bc3</link>
		<pubDate>Wed, 07 Mar 2012 01:21:51 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop/c1070bba338146b69a14a00d00167bc3#c1070bba338146b69a14a00d00167bc3</guid>
		<dc:creator>Craig Matthews</dc:creator>
		<slash:comments>21</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Craig_Matthews/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Win7 deletes shortcuts on the desktop</title>
		<description><![CDATA[<p>Just a user here, and from my view on this,&nbsp;the OS should NEVER delete files that I created without asking me.&nbsp; (And when it does ask me, I'd like&nbsp;the default response to&nbsp;be [no].)&nbsp;&nbsp;</p><p>My org just changed a bunch of path names&nbsp;on our shared drives (every reorg/merger eventually leads to this).&nbsp; Trying to open a shared/network folder just gave me the popup, and I reacted too quickly and deleted&nbsp;a shortcut.&nbsp;It didnt even put it in the recycle bin where I&nbsp;could recover it.&nbsp;Soon, many of them will start getting deleted by the scheduled cleanups some of you are talking about... grrrrrr.</p><p>If it had not been deleted, I'd at least have a starting point on rebuilding it.&nbsp; Probably just need to change one letter in the path.&nbsp;&nbsp;</p><p>It really drives me crazy that there are sys admins (dictators) out there who think this is OK!</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop/e2a5c04abfc54fbe8199a11b0128b6e7#e2a5c04abfc54fbe8199a11b0128b6e7</link>
		<pubDate>Sun, 02 Dec 2012 18:00:18 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Win7-deletes-shortcuts-on-the-desktop/e2a5c04abfc54fbe8199a11b0128b6e7#e2a5c04abfc54fbe8199a11b0128b6e7</guid>
		<dc:creator>DrDuke</dc:creator>
		<slash:comments>21</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/DrDuke/Discussions/RSS</wfw:commentRss>
	</item>
</channel>
</rss>