我正在尝试使用 ProcessStartInfo 运行 exe。问题是我只想指定exe名称,并将可执行路径添加到Windows中的PATH环境变量中。当我尝试运行我的应用程序时,我得到了 FileNotFoundException。当我使用全名开始该过程时,一切正常。有任何想法吗?
- 编辑:感谢您的评论,我举个例子让它更清楚:
ProcessStartInfo p = new ProcessStartInfo("example.exe");
我在 Windows 环境 PATH 变量中手动添加了 example.exe 的路径,但我的应用程序仍然无法启动进程 example.exe