# 13.4.在 FreeBSD 上运行第一个 WINE 程序

## 13.4.1. 从命令行运行程序

有两种方法可以从终端启动 Windows 程序。第一种也是最直接的方法是导航到包含程序可执行文件（.EXE）的目录，并运行以下命令：

```sh
% wine program.exe
```

对于需要命令行参数的应用程序，可以像平常一样将参数添加到可执行文件后面：

```sh
% wine program2.exe -file file.txt
```

或者，为了在脚本中使用该程序，可以提供可执行文件的完整路径，例如：

```sh
% wine /home/user/bin/program.exe
```

## 13.4.2. 从 GUI 运行程序

安装图形化界面后，图形化外壳程序应该已经更新了与 Windows 可执行文件（.EXE）的关联。现在，可以使用文件管理器浏览系统，并像其他文件和程序一样启动 Windows 应用程序（根据桌面设置，可能是单击或双击）。

在大多数桌面环境中，右键点击文件，检查上下文菜单中是否有打开该文件的选项。默认选项应该是通过 **Wine Windows 程序加载器** 来运行，具体如下面的截图所示：

![wine run np++ 1](https://docs.freebsd.org/images/books/handbook/wine/wine-run-np++-1.png)

如果程序没有按预期运行，可以尝试从命令行启动它，并检查终端中显示的任何消息以进行故障排除。

如果安装后 WINE 不是默认的 .EXE 文件应用程序，请检查当前桌面环境、图形外壳程序或文件管理器中的 MIME 关联。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://handbook.bsdcn.org/di-13-zhang-wine/13.4.-zai-freebsd-shang-yun-hang-di-yi-ge-wine-cheng-xu.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
