为什么要在 Windows 中一次打开多个程序(open multiple programs at once in Windows)?最近,我办公室里有人问我,他们如何一次打开多个桌面应用程序,而不必单独单击每个应用程序。
通常,我会打电话给那个人懒惰(person lazy)并告诉他们不要打扰我,但由于这个人正在执行重复性任务并且需要每天打开相同的应用程序,我想我会想出一个解决方案。
我还发现,不管怎样,我通常每天早上都会打开几个程序:用于Internet 浏览(Internet browsing)的 Chrome 、用于检查电子邮件的Outlook和用于编写代码的(Outlook)Visual Foxpro(因为我是一名程序员)。因此,我决定创建一个所谓的 批处理文件( batch file)来一次打开所有三个应用程序,而不是单击三个图标!
您可以在Windows中非常轻松地创建(Windows)批处理文件(batch file),创建它们所需要的只是记事本!此外,我还介绍了如何在计算机启动时使用任务计划程序(Task Scheduler)来运行批处理文件(batch file),以便程序启动而无需单击一次!
如何在Windows中创建批处理文件(Batch File)
步骤 1. 首先,打开记事本
步骤 2(Step 2)。复制并粘贴(Copy and paste)下面的行作为文件中的第一行:
@echo off
Echo off 基本上告诉 Windows 在运行(Echo)批处理文件(batch file)中的命令时不要给您任何消息或弹出窗口。
步骤 3(Step 3)。现在我们需要为我们要打开的三个程序中的每一个实际调用可执行文件。所以在我们的示例中,我想打开Firefox、Outlook和Foxpro。接下来的三行如下所示:
start “Chrome” “C:\Program Files (x86)\Google\Chrome\Application\chrome.exe”
start “Outlook” “C:\Program Files\Microsoft Office\Office12\Outlook.exe”
start “Foxpro” “C:\Program Files\Microsoft Visual FoxPro 9\vfp9.exe”
上面的每个命令都包含三个部分,我将在下面解释:
start - 这是批处理文件中用于打开程序的命令
“App Name” – 第二个参数是您要打开的应用程序的名称。您可以在此处输入您喜欢的任何名称,因为它仅将此参数用于标题目的。
“App Path” ——最后一个参数是程序可执行文件的实际路径。
您始终可以通过右键单击图标并转到Properties来找到程序的路径。例如,如果我想知道Firefox的可执行文件的路径,我会右键单击并选择属性。
现在我需要做的就是查看目标(Target)框中的路径,然后简单地将其复制并粘贴(copy and paste)到我的批处理文件脚本(batch file script)中。
请注意,某些快捷方式的目标框(Target box)将为空,如下所示,主要用于Microsoft Office程序。
如果是这种情况,您必须手动去系统上查找EXE 文件(EXE file)。对于Office ,如果您安装的是 64 位版本,则所有内容都位于C:\Program Files\Microsoft Office\Officexx C:\Program Files (x86)\Microsoft Office\Officexx中。应用程序文件通常只是程序的名称,如EXCEL、WORD 或 POWERPOINT(WORD or POWERPOINT)。
将所有条目添加到文件后,批处理文件(batch file)应如下所示:
现在您所要做的就是将其保存为批处理文件(batch file),这非常容易。转到文件(File)并单击另存为( Save As)。给你的文件起一个像“ Test.bat ”这样的名字。请注意,我手动将 .BAT 添加到文件名中。(file name)最后,将Save As Type更改为All Files而不是Text Documents。
而已!您现在应该继续测试您的批处理文件(batch file),看看您的所有程序是否都加载了。我发现的一件事是,由于某种原因,通过批处理文件(batch file)加载应用程序要快得多。我不太确定为什么,但Chrome、Outlook 和 Firefox(Outlook and Firefox) 的加载速度都比我通常单击它们时快了几秒钟。
在 PC 启动时安排批处理文件
现在让我们安排我们的批处理文件(batch file)在我们第一次登录Windows时运行。为此,请单击开始(Start),输入任务计划程序并单击(task scheduler and click)第一个链接。
不要因为看界面而不知所措,因为我们只需要创建一个非常简单的任务。在右侧,(hand side)您应该看到创建基本任务(Create Basic Task)的链接。继续并单击它。
现在给你的基本任务一个名字,可以是你想要的任何名字。如果你愿意,你也可以给它一个描述。完成后单击下一步(Click Next)。
下一步是选择触发器。在我们的例子中,我们希望在登录计算机时运行批处理文件,因此选择(batch file)When I log on。无论如何,这是唯一真正有意义的选择。
下一步是选择一个动作。在我们的例子中,操作将是运行我们的批处理脚本(batch script),所以选择Start a program。
最后,我们必须在登录计算机时实际选择要运行的批处理文件。(batch file)继续并单击“浏览”按钮并导航(Browse button and navigate)到批处理文件(batch file)的位置。
单击下一步(Next),然后单击完成(Finish)。现在继续并重新启动您的计算机,当您登录Windows时程序应该会打开!很整洁(Pretty neat)吧?如果您有任何问题,请发表评论。享受!
How to Open Multiple Programs in Windows at Once
Why would you ever want to open multiple programs at once in Windows? Recently, I had someone at my office ask me how they can open several desktop applications at one time without having to click on each application individually.
Normally, I would have called the person lazy and told them to stop bothering me, but since this person was performing a repetitive task and needed to open the same applications every day, I thought I would come up with a solution.
I also found that I usually open a couple of programs every morning no matter what: Chrome for Internet browsing, Outlook for checking email, and Visual Foxpro for writing code (since I’m a programmer). So instead of clicking on three icons, I decided to create what is called a batch file to open all three applications at once!
You can create batch files in Windows very easily and all you need to create them is Notepad! Also, I cover how you can use Task Scheduler to run your batch file when your computer boots so that the programs start without even having to click once!
How to Create a Batch File in Windows
Step 1. First, open Notepad
Step 2. Copy and paste the line below as the first line in the file:
@echo off
Echo off basically tells Windows to not give you any messages or popup windows when running the commands in the batch file.
Step 3. Now we need to actually call the executable for each of the three programs that we want to open. So in our example, I want to open Firefox, Outlook, and Foxpro. The next three lines would look like this:
start “Chrome” “C:\Program Files (x86)\Google\Chrome\Application\chrome.exe”
start “Outlook” “C:\Program Files\Microsoft Office\Office12\Outlook.exe”
start “Foxpro” “C:\Program Files\Microsoft Visual FoxPro 9\vfp9.exe”
There are three parts to each command above, which I explain below:
start – That is the command used in batch files to open programs
“App Name” – The second parameter is the name of the application you are going to be opening. You can put any name you like here since it only uses this parameter for title purposes.
“App Path” – The last parameter is the actual path to the executable file for the program.
You can always find the path of a program by right clicking on the icon and going to Properties. For example, if I wanted to know the path to the executable file for Firefox, I would right-click and choose Properties.
Now all I need to do is look at the path in the Target box and simply copy and paste that into my batch file script.
Note that there are certain shortcuts where the Target box will be empty like shown below, mostly with Microsoft Office programs.
If this is the case, you have to manually go and look for the EXE file on the system. For Office, everything is located in C:\Program Files\Microsoft Office\Officexx if you installed the 64-bit version or C:\Program Files (x86)\Microsoft Office\Officexx if you installed the 32-bit version. The application files are usually just the name of the program like EXCEL, WORD or POWERPOINT.
After you have added all the entries to your file, the batch file should look something like this:
Now all you have to do is actually save it as a batch file, which is very easy. Go to File and click Save As. Give your file a name like “Test.bat“. Note that I added the .BAT to the file name manually. Lastly, change the Save As Type to All Files instead of Text Documents.
That’s it! You should now go ahead and test out your batch file and see if all of your programs load up. One thing I have found is that loading applications via a batch file is much faster for some reason. I’m not really sure why, but Chrome, Outlook and Firefox all loaded several seconds faster than when I normally click on them.
Schedule Batch File on PC Startup
Now let’s schedule our batch file to run when we first log into Windows. To do this, click on Start, type in task scheduler and click on the first link.
Don’t become overwhelmed looking at the interface because we only have to create a very simple task. On the right hand side, you should see a link to Create Basic Task. Go ahead and click on that.
Now give your basic task a name, which can be whatever you want. You can also give it a description if you like. Click Next when done.
The next step is to choose the trigger. In our case, we want the batch file to be run when we log onto the computer, so choose When I log on. That’s the only option that really makes sense anyway.
The next step is to choose an action. In our case, the action will be to run our batch script, so choose Start a program.
Finally, we have to actually choose the batch file we want to run when we log onto the computer. Go ahead and click on the Browse button and navigate to the location of your batch file.
Click Next and then click Finish. Now go ahead and restart your computer and the programs should open when you log into Windows! Pretty neat, huh? If you have any questions, post a comment. Enjoy!