|
Re: Question about [System.Diagnostics.Process]::Start() On Jul 21, 5:56 am, a...@nodisabilities.com wrote:
> I am trying to figure out how to start a process with parameters.
>
> For example I can do [System.Diagnostics.Process]::Start("outlook")
> and Outlook launches.
>
> I would like to do [System.Diagnostics.Process]::Start("outlook /
> safe")
>
> But I get the following error
>
> PS > [System.Diagnostics.Process]::Start("outlook /safe")
> Exception calling "Start" with "1" argument(s): "The system cannot
> find the file specified"
> At line:1 char:36
> + [System.Diagnostics.Process]::Start( <<<< "outlook /safe")
>
> Thanks
>
> Andy
What you want is the overload of the Process.Start method that takes
the arguments as the second parameter:
[System.Diagnostics.Process]::Start( "outlook", "/safe" )
Good luck.
Jeff |