Specifies a set of values that are used when you start a process.
Public Constructors | |
process_start_info ()=default | |
Initializes a new instance of the xtd::diagnostics::process_start_info class without specifying a file name with which to start the process. | |
process_start_info (const xtd::string &file_name) | |
Initializes a new instance of the xtd::diagnostics::process_start_info class and specifies a file name such as an application or document with which to start the process. | |
process_start_info (const xtd::string &file_name, const xtd::string &arguments) | |
Initializes a new instance of the xtd::diagnostics::process_start_info class, specifies an application file name with which to start the process, and specifies a set of command-line arguments_ to pass to the application. | |
Public Properties | |
const xtd::string & | arguments () const noexcept |
Gets the set of command-line arguments to use when starting the application. | |
process_start_info & | arguments (const xtd::string &value) noexcept |
Sets the set of command-line arguments to use when starting the application. | |
bool | create_no_window () const noexcept |
Gets a value indicating whether to start the process in a new window. | |
process_start_info & | create_no_window (bool value) noexcept |
Sets a value indicating whether to start the process in a new window. | |
const xtd::string & | domain () const noexcept |
Gets a value that identifies the domain to use when starting the process. | |
process_start_info & | domain (const xtd::string &value) noexcept |
Sets a value that identifies the domain to use when starting the process. | |
const std::map< xtd::string, xtd::string > & | environment () const noexcept |
Gets the environment variables that apply to this process and its child processes. | |
std::map< xtd::string, xtd::string > & | environment () noexcept |
Gets the environment variables that apply to this process and its child processes. | |
const std::map< xtd::string, xtd::string > & | environment_variables () const noexcept |
Gets search paths for files, directories for temporary files, application-specific options, and other similar information. | |
std::map< xtd::string, xtd::string > & | environment_variables () noexcept |
Gets search paths for files, directories for temporary files, application-specific options, and other similar information. | |
bool | error_dialog () const noexcept |
Gets a value indicating whether an error dialog box is displayed to the user if the process cannot be started. | |
process_start_info & | error_dialog (bool value) noexcept |
Sets a value indicating whether an error dialog box is displayed to the user if the process cannot be started. | |
intptr | error_dialog_parent_handle () const noexcept |
Gets the window handle to use when an error dialog box is shown for a process that cannot be started. | |
process_start_info & | error_dialog_parent_handle (intptr value) noexcept |
Sets the window handle to use when an error dialog box is shown for a process that cannot be started. | |
const xtd::string & | file_name () const noexcept |
Gets the application or document to start. | |
process_start_info & | file_name (const xtd::string &value) noexcept |
Sets the application or document to start. | |
bool | load_user_profile () const noexcept |
Gets a value that indicates whether the Windows user profile is to be loaded from the registry. | |
process_start_info & | load_user_profile (bool value) noexcept |
Sets a value that indicates whether the Windows user profile is to be loaded from the registry. | |
const xtd::security::secure_string & | password () const noexcept |
Gets a secure string that contains the user password to use when starting the process. | |
process_start_info & | password (const xtd::security::secure_string &value) noexcept |
Sets a secure string that contains the user password to use when starting the process. | |
xtd::string | password_in_clear_text () const noexcept |
Gets the user password in clear text to use when starting the process. | |
process_start_info & | password_in_clear_text (const xtd::string &value) noexcept |
Sets the user password in clear text to use when starting the process. | |
bool | redirect_standard_error () const noexcept |
Gets a value that indicates whether the error output of an application is written to the xtd::diagnostics::process::standard_error stream. | |
process_start_info & | redirect_standard_error (bool value) noexcept |
Sets a value that indicates whether the error output of an application is written to the xtd::diagnostics::process::standard_error stream. | |
bool | redirect_standard_input () const noexcept |
Gets a value indicating whether the input for an application is read from the Process.StandardInput stream. | |
process_start_info & | redirect_standard_input (bool value) noexcept |
Sts a value indicating whether the input for an application is read from the Process.StandardInput stream. | |
bool | redirect_standard_output () const noexcept |
Gets a value that indicates whether the textual output of an application is written to the xtd::diagnostics::process::standard_output stream. | |
process_start_info & | redirect_standard_output (bool value) noexcept |
Sets a value that indicates whether the textual output of an application is written to the xtd::diagnostics::process::standard_output stream. | |
const xtd::string & | user_name () const noexcept |
Gets the user name to be used when starting the process. | |
process_start_info & | user_name (const xtd::string &value) noexcept |
Sets the user name to be used when starting the process. | |
bool | use_shell_execute () const noexcept |
Gets a value indicating whether to use the operating system shell to start the process. | |
process_start_info & | use_shell_execute (bool value) noexcept |
Sets a value indicating whether to use the operating system shell to start the process. | |
xtd::string | verb () const noexcept |
Gets the verb to use when opening the application or document specified by the FileName property. | |
process_start_info & | verb (const xtd::string &value) noexcept |
Sts the verb to use when opening the application or document specified by the FileName property. | |
xtd::collections::generic::list< xtd::string > | verbs () const |
Gets the set of verbs associated with the type of file specified by the xtd::diagnostics::process_start_info::file_name property. | |
xtd::diagnostics::process_window_style | window_style () const noexcept |
Gets the window state to use when the process is started. | |
process_start_info & | window_style (xtd::diagnostics::process_window_style value) noexcept |
Sets the window state to use when the process is started. | |
const xtd::string & | working_directory () const noexcept |
When the xtd::diagnostics::process_start_info::use_shell_execute property is false , gets or sets the working directory for the process to be started. When xtd::diagnostics::process_start_info::use_shell_execute is true , gets or sets the directory that contains the process to be started. | |
process_start_info & | working_directory (const xtd::string &value) noexcept |
When the xtd::diagnostics::process_start_info::use_shell_execute property is false , gets or sets the working directory for the process to be started. When xtd::diagnostics::process_start_info::use_shell_execute is true , gets or sets the directory that contains the process to be started. | |
Additional Inherited Members | |
![]() | |
object ()=default | |
Create a new instance of the ultimate base class object. | |
virtual bool | equals (const object &obj) const noexcept |
Determines whether the specified object is equal to the current object. | |
virtual xtd::size | get_hash_code () const noexcept |
Serves as a hash function for a particular type. | |
virtual type_object | get_type () const noexcept |
Gets the type of the current instance. | |
template<class object_t > | |
xtd::uptr< object_t > | memberwise_clone () const |
Creates a shallow copy of the current object. | |
virtual xtd::string | to_string () const noexcept |
Returns a xtd::string that represents the current object. | |
![]() | |
template<class object_a_t , class object_b_t > | |
static bool | equals (const object_a_t &object_a, const object_b_t &object_b) noexcept |
Determines whether the specified object instances are considered equal. | |
template<class object_a_t , class object_b_t > | |
static bool | reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept |
Determines whether the specified object instances are the same instance. | |
|
default |
Initializes a new instance of the xtd::diagnostics::process_start_info class without specifying a file name with which to start the process.
|
explicit |
Initializes a new instance of the xtd::diagnostics::process_start_info class and specifies a file name such as an application or document with which to start the process.
file_name_ | An application or document with which to start a process. |
xtd::diagnostics::process_start_info::process_start_info | ( | const xtd::string & | file_name, |
const xtd::string & | arguments | ||
) |
Initializes a new instance of the xtd::diagnostics::process_start_info class, specifies an application file name with which to start the process, and specifies a set of command-line arguments_ to pass to the application.
file_name | An application with which to start a process. |
arguments | Command-line arguments to pass to the application when the process starts. |
|
noexcept |
Gets the set of command-line arguments to use when starting the application.
|
noexcept |
Sets the set of command-line arguments to use when starting the application.
value | File type–specific arguments that the system can associate with the application specified in the xtd::diagnostics::process_start_info::file_name property. The default is an empty string (""). |
|
noexcept |
Gets a value indicating whether to start the process in a new window.
true
if the process should be started without creating a new window to contain it; otherwise, false
. The default is false
. true
or the xtd::diagnostics::process_start_info::user_name and xtd::diagnostics::process_start_info::password properties are not empty, the xtd::diagnostics::process_start_info::create_no_window property value is ignored and a new window is created.
|
noexcept |
Sets a value indicating whether to start the process in a new window.
value | true if the process should be started without creating a new window to contain it; otherwise, false . The default is false . |
true
or the xtd::diagnostics::process_start_info::user_name and xtd::diagnostics::process_start_info::password properties are not empty, the xtd::diagnostics::process_start_info::create_no_window property value is ignored and a new window is created.
|
noexcept |
Gets a value that identifies the domain to use when starting the process.
|
noexcept |
Sets a value that identifies the domain to use when starting the process.
value | The Active Directory Domain to use when starting the process. The xtd::diagnostics::process_start_info::domain property is primarily of interest to users within enterprise environments that use Active Directory. |
|
noexcept |
Gets the environment variables that apply to this process and its child processes.
my_process.start_info().environment().insert({"TempPath", "C:\\Temp"});. You must set the xtd::diagnostics::process_start_info::use_shell_execute property to
false
to start the process after changing the xtd::diagnostics::process_start_info::environment property. If xtd::diagnostics::process_start_info:use_shell_execute is true
, an xtd::invalid_operation_exception is thrown when the xtd::diagnostics::process::start method is called.
|
noexcept |
Gets the environment variables that apply to this process and its child processes.
my_process.start_info().environment().insert({"TempPath", "C:\\Temp"});. You must set the xtd::diagnostics::process_start_info::use_shell_execute property to
false
to start the process after changing the xtd::diagnostics::process_start_info::environment property. If xtd::diagnostics::process_start_info:use_shell_execute is true
, an xtd::invalid_operation_exception is thrown when the xtd::diagnostics::process::start method is called.
|
noexcept |
Gets search paths for files, directories for temporary files, application-specific options, and other similar information.
my_process.startInfo().environment_variables().insert({"TempPath", "C:\\Temp"});. You must set the xtd::diagnostics::process_start_info::use_shell_execute property to
false
to start the process after changing the xtd::diagnostics::process_start_info::environment_variables property. If xtd::diagnostics::process_start_info::use_shell_execute is true
, an xtd::invalid_operation_exception is thrown when the xtd::diagnostics::process::start method is called.
|
noexcept |
Gets search paths for files, directories for temporary files, application-specific options, and other similar information.
my_process.startInfo().environment_variables().insert({"TempPath", "C:\\Temp"});. You must set the xtd::diagnostics::process_start_info::use_shell_execute property to
false
to start the process after changing the xtd::diagnostics::process_start_info::environment_variables property. If xtd::diagnostics::process_start_info::use_shell_execute is true
, an xtd::invalid_operation_exception is thrown when the xtd::diagnostics::process::start method is called.
|
noexcept |
Gets a value indicating whether an error dialog box is displayed to the user if the process cannot be started.
true
if an error dialog box should be displayed on the screen if the process cannot be started; otherwise, false
. The default is false
. true
if you want to set xtd::diagnostics::process_start_info::error_dialog to true
.
|
noexcept |
Sets a value indicating whether an error dialog box is displayed to the user if the process cannot be started.
value | true if an error dialog box should be displayed on the screen if the process cannot be started; otherwise, false . The default is false . |
true
if you want to set xtd::diagnostics::process_start_info::error_dialog to true
.
|
noexcept |
Gets the window handle to use when an error dialog box is shown for a process that cannot be started.
true
, the xtd::diagnostics::process_start_info::error_dialog_parent_handle property specifies the parent window for the dialog box that is shown. It is useful to specify a parent to keep the dialog box in front of the application.
|
noexcept |
Sets the window handle to use when an error dialog box is shown for a process that cannot be started.
value | A pointer to the handle of the error dialog box that results from a process start failure. |
true
, the xtd::diagnostics::process_start_info::error_dialog_parent_handle property specifies the parent window for the dialog box that is shown. It is useful to specify a parent to keep the dialog box in front of the application.
|
noexcept |
Gets the application or document to start.
true
, you can start any document and perform operations on the file, such as printing, with the xtd::diagnostics::process component. When xtd::diagnostics::process_start_info::use_shell_execute is false
, you can start only executables with the xtd::diagnostics::process component.
|
noexcept |
Sets the application or document to start.
value | string The name of the application to start, or the name of a document of a file type that is associated with an application and that has a default open action available to it. The default is an empty string (""). |
true
, you can start any document and perform operations on the file, such as printing, with the xtd::diagnostics::process component. When xtd::diagnostics::process_start_info::use_shell_execute is false
, you can start only executables with the xtd::diagnostics::process component.
|
noexcept |
Gets a value that indicates whether the Windows user profile is to be loaded from the registry.
true
if the Windows user profile should be loaded; otherwise, false
. The default is false
. true
, the user's profile in the HKEY_USERS registry key is loaded. Loading the profile can be time-consuming. Therefore, it is best to use this value only if you must access the information in the HKEY_CURRENT_USER registry key.
|
noexcept |
Sets a value that indicates whether the Windows user profile is to be loaded from the registry.
value | true if the Windows user profile should be loaded; otherwise, false . The default is false . |
true
, the user's profile in the HKEY_USERS registry key is loaded. Loading the profile can be time-consuming. Therefore, it is best to use this value only if you must access the information in the HKEY_CURRENT_USER registry key.
|
noexcept |
Gets a secure string that contains the user password to use when starting the process.
false
, o an xtd::invalid_operation_exception will be thrown when the xtd::diagnostics::process::start(process_start_info) method is called.
|
noexcept |
Sets a secure string that contains the user password to use when starting the process.
value | The user password to use when starting the process. |
false
, o an xtd::invalid_operation_exception will be thrown when the xtd::diagnostics::process::start(process_start_info) method is called.
|
noexcept |
Gets the user password in clear text to use when starting the process.
|
noexcept |
Sets the user password in clear text to use when starting the process.
value | string The user password in clear text. |
|
noexcept |
Gets a value that indicates whether the error output of an application is written to the xtd::diagnostics::process::standard_error stream.
true
if error output should be written to xtd::diagnostics::process::standard_error; otherwise, false
. The default is false
. false
, and you must set xtd::diagnostics::process_start_info::redirect_standard_error to true
. Otherwise, reading from the xtd::diagnostics::process::standard_error stream throws an exception.
|
noexcept |
Sets a value that indicates whether the error output of an application is written to the xtd::diagnostics::process::standard_error stream.
value | true if error output should be written to xtd::diagnostics::process::standard_error; otherwise, false . The default is false . |
false
, and you must set xtd::diagnostics::process_start_info::redirect_standard_error to true
. Otherwise, reading from the xtd::diagnostics::process::standard_error stream throws an exception.
|
noexcept |
Gets a value indicating whether the input for an application is read from the Process.StandardInput stream.
true
if input should be read from Process.StandardInput; otherwise, false
. The default is false
. false
, and you must set xtd::diagnostics::process_start_info::redirect_standard_input to true
. Otherwise, writing to the xtd::diagnostics::process::standard_input stream throws an exception.
|
noexcept |
Sts a value indicating whether the input for an application is read from the Process.StandardInput stream.
value | true if input should be read from Process.StandardInput; otherwise, false . The default is false . |
false
, and you must set xtd::diagnostics::process_start_info::redirect_standard_input to true
. Otherwise, writing to the xtd::diagnostics::process::standard_input stream throws an exception.
|
noexcept |
Gets a value that indicates whether the textual output of an application is written to the xtd::diagnostics::process::standard_output stream.
true
if output should be written to xtd::diagnostics::process::standard_output; otherwise, false
. The default is false
. false
, and you must set xtd::diagnostics::process_start_info::redirect_standard_output to true
. Otherwise, reading from the xtd::diagnostics::process::standard_output stream throws an exception.
|
noexcept |
Sets a value that indicates whether the textual output of an application is written to the xtd::diagnostics::process::standard_output stream.
value | true if output should be written to xtd::diagnostics::process::standard_output; otherwise, false . The default is false . |
false
, and you must set xtd::diagnostics::process_start_info::redirect_standard_output to true
. Otherwise, reading from the xtd::diagnostics::process::standard_output stream throws an exception.
|
noexcept |
Gets the user name to be used when starting the process.
false
, or an xtd::invalid_operation_exception will be thrown when the xtd::diagnostics::process::.start(xtd::diagnostics::process_start_info) method is called.
|
noexcept |
Sets the user name to be used when starting the process.
value | The user name to use when starting the process. |
false
, or an xtd::invalid_operation_exception will be thrown when the xtd::diagnostics::process::.start(xtd::diagnostics::process_start_info) method is called.
|
noexcept |
Gets a value indicating whether to use the operating system shell to start the process.
true
if the shell should be used when starting the process; false
if the process should be created directly from the executable file. The default is true
. false
enables you to redirect input, output, and error streams. false
if the xtd::diagnostics::process_start_info::user_name property is not an empty string, or an xtd::invalid_operation_exception will be thrown when the xtd::diagnostics::process::start(process_start_info) method is called. false
, you can start only executables by using the xtd::diagnostics::process object. true
if you set the xtd::diagnostics::process_start_info::error_dialog property to true
. true
, the xtd::diagnostics::process_start_info::working_directory property specifies the location of the executable. If working_directory is an empty string, it is assumed that the current directory contains the executable. false
, the xtd::diagnostics::process_start_info::working_directory property is not used to find the executable. Instead, it is used only by the process that is started and has meaning only within the context of the new process. When xtd::diagnostics::process_start_info::use_shell_execute is false
, the xtd::diagnostics::process_start_info::file_name property can be either a fully qualified path to the executable, or a simple executable name that the system will attempt to find within folders specified by the PATH environment variable.
|
noexcept |
Sets a value indicating whether to use the operating system shell to start the process.
value | true if the shell should be used when starting the process; false if the process should be created directly from the executable file. The default is true . |
false
enables you to redirect input, output, and error streams. false
if the xtd::diagnostics::process_start_info::user_name property is not an empty string, or an xtd::invalid_operation_exception will be thrown when the xtd::diagnostics::process::start(process_start_info) method is called. false
, you can start only executables by using the xtd::diagnostics::process object. true
if you set the xtd::diagnostics::process_start_info::error_dialog property to true
. true
, the xtd::diagnostics::process_start_info::working_directory property specifies the location of the executable. If working_directory is an empty string, it is assumed that the current directory contains the executable. false
, the xtd::diagnostics::process_start_info::working_directory property is not used to find the executable. Instead, it is used only by the process that is started and has meaning only within the context of the new process. When xtd::diagnostics::process_start_info::use_shell_execute is false
, the xtd::diagnostics::process_start_info::file_name property can be either a fully qualified path to the executable, or a simple executable name that the system will attempt to find within folders specified by the PATH environment variable.
|
noexcept |
Gets the verb to use when opening the application or document specified by the FileName property.
|
noexcept |
Sts the verb to use when opening the application or document specified by the FileName property.
value | The action to take with the file that the process opens. The default is an empty string (""), which signifies no action. |
xtd::collections::generic::list< xtd::string > xtd::diagnostics::process_start_info::verbs | ( | ) | const |
Gets the set of verbs associated with the type of file specified by the xtd::diagnostics::process_start_info::file_name property.
|
noexcept |
Gets the window state to use when the process is started.
xtd::invalid_enum_argument_exception | The window style is not one of the xtd::diagnostics::process_window_style enumeration members. |
|
noexcept |
Sets the window state to use when the process is started.
value | One of the enumeration values that indicates whether the process is started in a window that is maximized, minimized, normal (neither maximized nor minimized), or not visible. The default is xtd::diagnostics::process_window_style::normal. |
xtd::invalid_enum_argument_exception | The window style is not one of the xtd::diagnostics::process_window_style enumeration members. |
|
noexcept |
When the xtd::diagnostics::process_start_info::use_shell_execute property is false
, gets or sets the working directory for the process to be started. When xtd::diagnostics::process_start_info::use_shell_execute is true
, gets or sets the directory that contains the process to be started.
true
, the fully qualified name of the directory that contains the process to be started. When the xtd::diagnostics::process_start_info::use_shell_execute property is false
, the working directory for the process to be started. The default is an empty string (""). true
than when xtd::diagnostics::process_start_info::use_shell_execute is false
. When xtd::diagnostics::process_start_info::use_shell_execute is true
, the xtd::diagnostics::process_start_info::working_directory property specifies the location of the executable. If xtd::diagnostics::process_start_info::working_directory is an empty string, the current directory is understood to contain the executable. true
, the working directory of the application that starts the executable is also the working directory of the executable. false
, the xtd::diagnostics::process_start_info::working_directory property is not used to find the executable. Instead, its value applies to the process that is started and only has meaning within the context of the new process.
|
noexcept |
When the xtd::diagnostics::process_start_info::use_shell_execute property is false
, gets or sets the working directory for the process to be started. When xtd::diagnostics::process_start_info::use_shell_execute is true
, gets or sets the directory that contains the process to be started.
value | When xtd::diagnostics::process_start_info::use_shell_execute is true , the fully qualified name of the directory that contains the process to be started. When the xtd::diagnostics::process_start_info::use_shell_execute property is false , the working directory for the process to be started. The default is an empty string (""). |
true
than when xtd::diagnostics::process_start_info::use_shell_execute is false
. When xtd::diagnostics::process_start_info::use_shell_execute is true
, the xtd::diagnostics::process_start_info::working_directory property specifies the location of the executable. If xtd::diagnostics::process_start_info::working_directory is an empty string, the current directory is understood to contain the executable. true
, the working directory of the application that starts the executable is also the working directory of the executable. false
, the xtd::diagnostics::process_start_info::working_directory property is not used to find the executable. Instead, its value applies to the process that is started and only has meaning within the context of the new process.