<p>The product we are working on allows the user to easily set it up to run automatically whenever the computer is started. This is helpful because the product is part of the basic work environment of most of our users.<br>
This feature was implemented not so long ago and for a while all was well, but when we started testing this feature on Vista the product started behaving really weird on startup. Specifically, our product makes use of another product (lets call it X) that it launches whenever it needs its services. The actual problem is that whenever X is launched immediately after log-on, it crashes or reports critical errors related to disk access (this happens even when X is launched directly - not through our product).</p>

<p>This happens whenever we run our product by registering it in the "Run" key in the registry or place a shortcut to it in the "<em>Startup</em>" folder inside the "<em>Start Menu</em>", even when we put a delay of ~20 seconds before actually starting to run. When we changed the delay to 70 seconds, all is well.</p>

<p>We tried to reproduce the problem by launching our product manually immediately after logon (by double-clicking on a shortcut placed on the desktop) but to no avail.</p>

<p>Now how is it possible that applications that run normally a minute after logon report such hard errors when starting immediately after logon?</p>

[{'answer_id': 15808, 'author': 'Hershi', 'author_id': 1596, 'author_profile': 'https://Stackoverflow.com/users/1596', 'pm_score': 4, 'selected': True, 'text': '<p>This is the effect of a new feature in Vista called "Boxing":\nWindows has several mechanisms that allow the user/admin to set up applications to automatically run when windows starts. This feature is mostly used for one of these purposes:\n1. Programs that are part of the basic work environment of the user, such that the first action the user would usually take when starting the computer is to start them.\n2. All sorts of background "agents" - skype, messenger, winamp etc.</p>\n\n<p>When too many (or too heavy) programs are registered to run on startup the end result is that the user can\'t actually do anything for the first few seconds/minutes after login, which can be really annoying. In comes Vista\'s "Boxing" feature:</p>\n\n<p>Briefly, Vista forces all programs invoked through the Run key to operate at low priority for the first 60 seconds after login. This affects both <strong>I/O priority (which is set to Very Low) and CPU priority</strong>. Very Low priority I/O requests do not pass through the file cache, but go directly to disk. Thus, they are much slower than regular I/O. \nThe length of the boxing period is set by the registry value: \n"HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\\DelayedApps\\Delay_Sec". </p>\n\n<p>For a more detailed explanation see <a href="http://blogs.technet.com/askperf/archive/2008/03/28/startup-programs-on-windows-vista-inside-the-box.aspx" rel="nofollow noreferrer">here</a> and <a href="http://myitforum.com/cs2/blogs/scassells/archive/2008/02/05/boxing-and-the-case-of-the-slow-or-hanging-logon-script-in-vista.aspx" rel="nofollow noreferrer">here</a></p>\n'}, {'answer_id': 16312, 'author': 'JasonMichael', 'author_id': 1935, 'author_profile': 'https://Stackoverflow.com/users/1935', 'pm_score': 0, 'selected': False, 'text': '<p>The program probably needs some more info put into its properties.  It needs to "Run As", instead of just running.</p>\n\n<p>Maybe this application should be developed as a service, instead of a program to be launched, or you could have service that launches the program when its determined the best window of opportunity.  </p>\n'}]
['https://Stackoverflow.com/questions/15805', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1596/']