简体   繁体   English

单击可执行文件时如何在 WSL 中运行程序?

[英]How to run a program in WSL when I click on an executable?

Imagine I have a simple program that prints out hello, world to the terminal when executed.想象一下,我有一个简单的程序,它在执行时将 hello, world 打印到终端。

Usually, you would type in the terminal./a.out or whatever the name and extension (or not) of the program.通常,您会输入终端./a.out 或任何程序的名称和扩展名(或不是)。

I want to create an executable file that, when clicked, will open the terminal and run the program.我想创建一个可执行文件,单击该文件将打开终端并运行程序。 I'm using windows and linux subsystem for windows and the debian terminal from the windows store. I'm using windows and linux subsystem for windows and the debian terminal from the windows store. How can I make my program open the debian terminal and run the hello world program, when I click on the executable?当我单击可执行文件时,如何让我的程序打开 debian 终端并运行 hello world 程序?

You can simply create .bat file with startup of your app via wsl:您可以通过 wsl 启动应用程序来简单地创建.bat文件:

wsl NEEDED_DIR/a.out

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM