Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrong CreateProcess call #14

Open
frederich opened this issue Apr 11, 2016 · 0 comments · May be fixed by #15
Open

wrong CreateProcess call #14

frederich opened this issue Apr 11, 2016 · 0 comments · May be fixed by #15

Comments

@frederich
Copy link

I want to call the executable svn which is defined in my PATH environment variable with some arguments. I've used set_args instead of run_exe. The execute call fails, boost-process creates a wrong CreateProcess call.

std::vector<std::string> const args = { "svn", "propget", "-R", "svn:externals"};
using namespace boost;
system::error_code ec;
process::execute(process::set_args(args), process::set_on_error(ec));

See CreateProcess

If lpApplicationName is NULL, the first white space–delimited token of the command line specifies the module name. If you are using a long file name that contains a space, use quoted strings to indicate where the file name ends and the arguments begin (see the explanation for the lpApplicationName parameter). If the file name does not contain an extension, .exe is appended. Therefore, if the file name extension is .com, this parameter must include the .com extension. If the file name ends in a period (.) with no extension, or if the file name contains a path, .exe is not appended. If the file name does not contain a directory path, the system searches for the executable file in the following sequence:

The directory from which the application loaded.
The current directory for the parent process.
The 32-bit Windows system directory. Use the GetSystemDirectory function to get the path of this directory.
The 16-bit Windows system directory. There is no function that obtains the path of this directory, but it is searched. The name of this directory is System.
The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.
The directories that are listed in the PATH environment variable. Note that this function does not search the per-application path specified by the App Paths registry key. To include this per-application path in the search sequence, use the ShellExecute function.
@frederich frederich linked a pull request Apr 11, 2016 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant