简体   繁体   English

有没有办法在没有可执行文件位置的情况下运行程序?

[英]Is there a way to run a program without the location of the executable file?

I am looking to run a program (like Chrome for example) from C#, without the location of the executable file.我希望从 C# 运行一个程序(例如 Chrome),而没有可执行文件的位置。

The purpose of this is to create an application launcher that can be distributed across different computers with programs installed in different locations.这样做的目的是创建一个应用程序启动器,它可以分布在不同计算机上,程序安装在不同位置。

One option is adding your folder to the PATH (environment variable).一种选择是将您的文件夹添加到PATH (环境变量)。

" My computer -> properties -> advanced -> environment variables -> Path " and edit path by adding your .exe's directory path. My computer -> properties -> advanced -> environment variables -> Path ”并通过添加 .exe 的目录路径来编辑路径。

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

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