如何找到在不同计算机之间工作的工作目录。 -C
我正在运行两个进程,进程 A 由进程 B 使用以下示例打开:
createProcessHandle = CreateProcess(
TEXT("C:\\Users\Jamie\\Documents\\Application\\Debug\\ProcessA.exe"),
TEXT(""),
NULL,
NULL,
FALSE,
0,
NULL,
NULL,
&startupinfo,
&process_information
);
如您所见,进程依赖于给定的路径,我遇到的问题是,如果我更改 ProcessA.exe 的位置(例如备份/重复),不断重新编码路径是一个令人厌烦的过程。我希望能够让它运行,无论它在哪里,而不必手动重新编码路径。
有人可以建议解决这个问题吗?
编辑:我无权访问路径环境变量
I am running two processes,Process A is opened by Process B using the following example:
createProcessHandle = CreateProcess(
TEXT("C:\\Users\Jamie\\Documents\\Application\\Debug\\ProcessA.exe"),
TEXT(""),
NULL,
NULL,
FALSE,
0,
NULL,
NULL,
&startupinfo,
&process_information
);
As you can see the Process is reliant on the path given to it, the problem I have is that if I change the location of my ProcessA.exe (Such as a backup/duplicate) it's a tiresome process to keep recoding the path. I want to be able to make it run no matter where it is without having to recode the path manually.
Can anybody suggest a solution to this?
Edit: I do not have access to the path environment variable
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
基本上有两种选择。
There are basically two options.