You are probably very familiar with the startup programs function of Windows. While you can specify the applications you want to launch at the start of Windows, the ability to control the order in which they start is not available. However, there are a couple of ways you can easily overcome this limitation and control the startup order of applications.
您可能非常熟悉Windows的启动程序功能。 虽然可以指定要在Windows启动时启动的应用程序,但无法控制启动顺序。 但是,有两种方法可以轻松克服此限制并控制应用程序的启动顺序。
Note: this tutorial should work for any version of Windows, including Windows Server.
注意:本教程适用于任何版本的Windows,包括Windows Server。
使用WinPatrol (Using WinPatrol)
There are most likely several utilities which provide this functionality, but we are going to discuss using the popular WinPatrol monitoring application which features a delay startup control. As you can probably guess, this function allows you to specify a certain amount of time to wait before opening the respective application.
很有可能有几种实用程序可以提供此功能,但是我们将讨论使用流行的WinPatrol监视应用程序,该应用程序具有延迟启动控件。 您可能会猜到,该函数允许您指定一定的时间等待打开相应的应用程序。
WinPatrol makes this process very easy. On the Startup Programs tab, locate the applications you want to delay the startup for, right-click and select the “Move to Delayed Start Program List” option.
WinPatrol使此过程非常容易。 在“启动程序”选项卡上,找到要延迟启动的应用程序,右键单击并选择“移至延迟的启动程序列表”选项。
After selecting this option for all the target applications, click the Delayed Start tab. Here you can add additional applications manually and set the respective delay by highlighting the target entry and clicking “Delay Options”.
为所有目标应用程序选择此选项后,单击“延迟启动”选项卡。 您可以在此处手动添加其他应用程序,并通过突出显示目标条目并单击“延迟选项”来设置相应的延迟。
Now set the delay time and any respective parameters.
现在设置延迟时间和任何相应的参数。
Since WinPatrol initiates the launch commands, the delay time is respective to when it opens. So, of course, you must have WinPatrol as a startup application itself (which is the application default).
由于WinPatrol会启动启动命令,因此延迟时间与打开时相对应。 因此,当然,您必须具有WinPatrol作为启动应用程序本身(这是应用程序的默认设置)。
使用批处理脚本 (Using a Batch Script)
If you do not want to install or rely on “yet another application” or you simply want to get a bit geeky, a batch script can be used. Anyone can do this as it is very easy to setup and requires no batch programming knowledge.
如果您不想安装或依靠“另一个应用程序”,或者只是想变得有点怪异,则可以使用批处理脚本。 任何人都可以这样做,因为它非常容易设置,并且不需要批处理编程知识。
Open your Windows Startup folder by going to Start > All Programs, right-click on the Startup folder and selecting Open.
转到“开始”>“所有程序”,右键单击“启动”文件夹,然后选择“打开”,以打开Windows“启动”文件夹。
When the listing of programs appear, create a new text file named “StartupOrder.bat”.
当出现程序列表时,创建一个名为“ StartupOrder.bat”的新文本文件。
Edit the StartupOrder.bat file in Notepad to add the delay time and applications you want to launch. For this task, we will need the use of two batch commands: TIMEOUT and START.
在记事本中编辑StartupOrder.bat文件以添加延迟时间和要启动的应用程序。 对于此任务,我们将需要使用两个批处理命令:TIMEOUT和START。
The use of the TIMEOUT command is to specify the delay. Usage is simply this:
TIMEOUT命令的用途是指定延迟。 用法就是这样:
TIMEOUT /T seconds-to-wait
超时/ T 等待的秒数
For example the following two commands would wait 10 seconds and 2 minutes (120 seconds), respectively, before continuing:
例如,以下两个命令将分别等待10秒和2分钟(120秒),然后再继续:
TIMEOUT /T 10TIMEOUT /T 120
超时/ T 10超时/ T 120
The use of the START command is to launch the target application. The reason we use the START command instead of just entering the program name is to tell the batch script to launch the target application and move on without waiting until we close it. Our usage of this command is:
使用START命令启动目标应用程序。 我们使用START命令而不是仅输入程序名称的原因是告诉批处理脚本启动目标应用程序并继续运行,而无需等到我们关闭它。 该命令的用法是:
START “” “C:PathToApplication.exe”
开始“”“ C:PathToApplication.exe”
For example, the following two commands would open Notepad and the Calculator without waiting for the other to close (i.e. at the same time):
例如,以下两个命令将打开“记事本”和“计算器”,而无需等待另一个关闭(即同时):
START “” “Notepad.exe”START “” “Calc.exe”
开始“”“ Notepad.exe”开始“”“ Calc.exe”
Putting it Together
把它放在一起
All you need to do to get your custom StartupOrder.bat script working it combine the delay (TIMEOUT) and launch (START) commands in the order you want them processed.
使自定义StartupOrder.bat脚本工作所需要做的全部工作,将延迟(TIMEOUT)和启动(START)命令按照您要处理的顺序进行组合。
Here is the batch script which would implement the same startup delay we specified in the WinPatrol example above:
这是批处理脚本,它将实现与我们在上面的WinPatrol示例中指定的启动延迟相同的启动延迟:
@ECHO OFF
@回声关闭
TIMEOUT /T 10REM Total Delay = 10 secondsSTART “” “C:Program Files (x86)Microsoft OfficeOffice14OUTLOOK.EXE”
超时/ T 10REM总延迟= 10秒START“”“ C:Program Files(x86)Microsoft OfficeOffice14OUTLOOK.EXE”
TIMEOUT /T 20REM Total Delay = 30 secondsSTART “” “C:Program Files (x86)Microsoft OfficeOffice14WINWORD.EXE”START “” “C:Program Files (x86)CitrixGoToMeeting457g2mstart.exe”
超时/ T 20REM总延迟= 30秒START“”“ C:Program Files(x86)Microsoft OfficeOffice14WINWORD.EXE” START“” C:Program Files(x86)CitrixGoToMeeting457g2mstart.exe“
TIMEOUT /T 20REM Total Delay = 50 secondsSTART “” “C:Program Files (x86)Microsoft OfficeOffice14EXCEL.EXE”
超时/ T 20REM总延迟= 50秒START“”“ C:Program Files(x86)Microsoft OfficeOffice14EXCEL.EXE”
You can use this example to get you started and customize as needed.
您可以使用此示例来入门并根据需要进行自定义。
翻译自: https://www.howtogeek.com/52043/how-to-control-the-order-of-startup-programs-in-windows/