If you’re like me and need multiple programs to start upon login, your hard drive is likely inundated with requests, causing a major slowdown as the OS seeks to fill each and every request simultaneously. Furthermore, I have some programs that are dependent upon others, so when they load out of order, I have to shutdown and restart the applications or perform some extra steps to reconfigure the program. An example of this is synchronizing DropBox and ZumoDrive. If DropBox starts before ZumoDrive, it never syncs and hangs in an “Indexing…” state. This matter is complicated by storing my KeePass database on my ZumoDrive. Because KeePass loads before ZumoDrive, it can’t find the Z: location and I have to re-locate the KDB file for it to load.
One solution to this problem is to start the programs manually, which is monotonous. A much better solution is to control the exact startup sequence, giving each program a small delay to fully load before starting the next program. A solution I used in the past for Windows was a batch file. This suffers from a couple of problems:
- By default, there is no “sleep” command. You can install the Windows 2003 Administrator Toolkit for the functionality, or resort to a ping delay trick. Both of these are less-than-ideal.
- This is 2009. Batch files aren’t exactly cool.
To overcome these issues, I took a gander at my latest favorite scripting language, PowerShell; it handily solves both issues. This is a very easy hack and to accomplish it, there are only a few steps. The only considerations for this project is to ensure that PowerShell v1 or v2 is installed and configured to run scripts locally. With those assumptions, let’s get started:
Continue reading »