![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Using ProcessStartInfo with [System.Diagnostics.Process]::Start I want to be able to control the application that is started using this method. Any ideas on how to setup a ProcessStartInfo that I can pass to [System.Diagnostics.Process]::Start? http://msdn2.microsoft.com/en-us/lib...ess.start.aspx |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Using ProcessStartInfo with [System.Diagnostics.Process]::Start Check back a few days and you'll see a post I made demoing an "Invoke-Halo" script that does exactly this. In general form, here's how it works: $psi = New-Object System.Diagnostics.ProcessStartInfo $psi.Filename = ... # name or complete path $psi.Arguments = ... # complete argument string. Here's a Start-Process function I wrote that handles 2 of the ProcessStartInfo properties: function Start-Process { Param([string]$Filename,[string]$ArgumentString = [System.String]::Empty) $si = New-Object System.Diagnostics.ProcessStartInfo $si.Filename = $Filename; if($ArgumentString){$si.Arguments = $ArgumentString}; $si.Filename, $si.Arguments; [System.Diagnostics.Process]::Start($si); } "Brandon Shell" <tshell.mask@gmail.com> wrote in message news:Ou7cmNXvGHA.4384@TK2MSFTNGP04.phx.gbl... >I want to be able to control the application that is started using this >method. Any ideas on how to setup a ProcessStartInfo that I can pass to >[System.Diagnostics.Process]::Start? > > http://msdn2.microsoft.com/en-us/lib...ess.start.aspx > > |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Using ProcessStartInfo with [System.Diagnostics.Process]::Start You rock my man... that was exactly what I was looking for. "Alex K. Angelopoulos [MVP]" <aka@online.mvps.org> wrote in message news:eNrtjfXvGHA.1772@TK2MSFTNGP06.phx.gbl... > Check back a few days and you'll see a post I made demoing an > "Invoke-Halo" script that does exactly this. In general form, here's how > it works: > > $psi = New-Object System.Diagnostics.ProcessStartInfo > $psi.Filename = ... # name or complete path > $psi.Arguments = ... # complete argument string. > > Here's a Start-Process function I wrote that handles 2 of the > ProcessStartInfo properties: > > function Start-Process > { > Param([string]$Filename,[string]$ArgumentString = [System.String]::Empty) > $si = New-Object System.Diagnostics.ProcessStartInfo > $si.Filename = $Filename; > if($ArgumentString){$si.Arguments = $ArgumentString}; > $si.Filename, $si.Arguments; > [System.Diagnostics.Process]::Start($si); > } > > "Brandon Shell" <tshell.mask@gmail.com> wrote in message > news:Ou7cmNXvGHA.4384@TK2MSFTNGP04.phx.gbl... >>I want to be able to control the application that is started using this >>method. Any ideas on how to setup a ProcessStartInfo that I can pass to >>[System.Diagnostics.Process]::Start? >> >> http://msdn2.microsoft.com/en-us/lib...ess.start.aspx >> >> > > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| [diagnostics.process]::start("exe") | PowerShell | |||
| redirecting standar output when using [System.Diagnostics.Process]::Start | PowerShell | |||
| Question about [System.Diagnostics.Process]::Start() | PowerShell | |||
| Wrap command shell in System.Diagnostics.Process | PowerShell | |||
| Stupid [Diagnostics.Process]::Start("..") tricks | PowerShell | |||