diff --git a/include/boost/process/v1/detail/windows/basic_cmd.hpp b/include/boost/process/v1/detail/windows/basic_cmd.hpp index 87a0e85d8..757a89bc7 100644 --- a/include/boost/process/v1/detail/windows/basic_cmd.hpp +++ b/include/boost/process/v1/detail/windows/basic_cmd.hpp @@ -162,7 +162,9 @@ struct exe_cmd_init : handler_base_ext } static exe_cmd_init exe_args_shell(string_type && exe, std::vector && args) { - std::vector args_ = {c_arg(Char()), std::move(exe)}; + std::vector args_ = {c_arg(Char())}; + if (!exe.empty()) + args_.emplace_back(std::move(exe)); args_.insert(args_.end(), std::make_move_iterator(args.begin()), std::make_move_iterator(args.end())); string_type sh = get_shell(Char());