Windows is very user friendly and GUI oriented operating system. Other operating systems like Unix, Linux, BSD came from non-GUI heritance and adopted the GUI experience in recent decade very good. In contrast Microsoft started to provide more productive command line support to use Windows operating systems features. One of the most used operation is starting applications. In this tutorial we will look how to start an GUI application from command line and relative ways. The started application can be also an command line application too.
Windows是非常用户友好和GUI导向的操作系统。 其他操作系统,例如Unix,Linux,BSD,都来自非GUI继承,并且在最近十年中采用GUI的经验非常好。 相反,Microsoft开始提供使用Windows操作系统功能的更高效的命令行支持。 最常用的操作之一是启动应用程序。 在本教程中,我们将研究如何从命令行和相对方式启动GUI应用程序。 启动的应用程序也可以是命令行应用程序。
从开始搜索框开始 (Start From Start Search Box)
The first way to start and app either GUI or non-GUI the start search box can be used. Normally this is used to search computer for file and directories but before starting to search files and directories it search for given term in commands and applications. We will start Windows Paint with the mspaint
command like below.
可以使用第一个启动和应用GUI或非GUI的方法,即开始搜索框。 通常,它用于在计算机上搜索文件和目录,但是在开始搜索文件和目录之前,它先在命令和应用程序中搜索给定术语。 我们将使用以下mspaint
命令启动Windows Paint。
![Start From Start Search Box](https://i-blog.csdnimg.cn/blog_migrate/983ab73d25e51659c8af1587ef30bbc2.png)
从运行命令框开始(Start With Run Command Box)
Run command box is used to run commands directly in a shell in Windows operating systems. Run command box provides easy shortcut for running commands. Run Command Box can be opened with WIN+r
keyboard shortcut. The application will be entered like below.
运行命令框用于直接在Windows操作系统的外壳程序中运行命令。 运行命令框提供了用于运行命令的简便快捷方式。 可以使用WIN+r
键盘快捷方式打开“运行命令框”。 如下所示输入应用程序。
![Start With Run Command Box](https://i-blog.csdnimg.cn/blog_migrate/4f60204e2b5dd7abb4fe2c8159d4c396.png)
从MS-DOS开始(Start From MS-DOS)
MS-DOS is actually a simple operating system for 30 years old. MS-DOS console can be accesses like below from the start menu. This is named Command Prompt
.
MS-DOS实际上是一个已有30年历史的简单操作系统。 可以从开始菜单通过以下方式访问MS-DOS控制台。 这称为Command Prompt
。
![Start From MS-DOS](https://i-blog.csdnimg.cn/blog_migrate/310330d3c886426582f1e7b000370c00.png)
After starting MS-DOS Command Prompt we will just input the mspaint
command and hit enter.
启动MS-DOS命令提示符后,我们将只输入mspaint
命令并按Enter。
![Start From MS-DOS](https://i-blog.csdnimg.cn/blog_migrate/706ab2c01a90f7870a0da176576a1808.png)
从Powershell开始(Start From Powershell)
Powershell is new command prompt provided by Microsoft as an alternative to the MS-DOS. Applications with or without GUI can be start with Powershell too. Starting is similar to the MS-DOS command prompt. First we will start Powershell
Powershell是Microsoft提供的新命令提示符,可以替代MS-DOS。 带有或不带有GUI的应用程序也可以从Powershell启动。 启动类似于MS-DOS命令提示符。 首先,我们将启动Powershell
![Start From Powershell](https://i-blog.csdnimg.cn/blog_migrate/5ef404a3f3e92143df94bb9e99e24d6f.png)
Then we will just run the command like mspaint
like below.
然后,我们将像下面这样运行像mspaint
这样的命令。
![Start From Powershell](https://i-blog.csdnimg.cn/blog_migrate/37026f17904de6e58ffa954208543987.png)
从批处理文件开始(Start From Batch File)
Batch files are used to run commands file a file. Batch file mechanism generally used to run Scheduled Jobs but there are different use cases too. We will write a batch file named paint.bat
and put mspaint
as containt into this file like below. The bat
extension is important.
批处理文件用于运行命令文件一个文件。 批处理文件机制通常用于运行计划作业,但也有不同的用例。 我们将编写一个名为paint.bat
的批处理文件,并将mspaint
作为包含内容放入此文件中,如下所示。 bat
延伸很重要。
paint.bat
paint.bat
mspaint
从文件资源管理器地址栏开始 (Start From File Explorer Address Bar)
File explorer is another useful tool to start an application. The location or address bar can be used to run an application. In this situation we should know and put the absolute path of the application to the location bar like below. In this example the full path of the mspaint
is
File Explorer是另一个启动应用程序的有用工具。 位置或地址栏可用于运行应用程序。 在这种情况下,我们应该知道应用程序的绝对路径并将其放在如下所示的位置栏中。 在此示例中, mspaint
的完整路径为
C:\Windows\System32\mspaint.exe
![Start From File Explorer Address Bar](https://i-blog.csdnimg.cn/blog_migrate/d3dbe41083f580ace539c83933902aa3.png)
翻译自: https://www.poftut.com/start-applications-command-line-windows-different-ways/