Using the “Get-Help” cmdlet would shed light on this.
[pre]
Get-Help Start-Process -Parameter filepath
[/pre]
That will return the below results:
-FilePath <String>
Specifies the optional path and file name of the program that runs in the process. Enter the name of an executable file or of a document, such as a .txt or .doc file, that is associated with a program on
the computer. This parameter is required.
If you specify only a file name, use the WorkingDirectory parameter to specify the path.
A parameter value is the input that the parameter takes. Because Windows
PowerShell is based on the Microsoft .NET Framework, parameter values are
represented in the syntax diagram by their .NET type.
For example, the Name parameter of Get-Help takes a String value, which
is a text string, such as a single word or multiple words enclosed in
quotation marks.
So based on the folder structure most commonly found on Windows OS the syntax would probably be something like.
Same error in each case: cannot find the file. It is on my C drive in the Program Files (x86) folder and is not in its own folder. The filename is called ImgBurn.exe (exactly like that).
But I am getting a grasp of what you mean, thanks.
That is odd, that would normally indicates there is an issue with the argument being passed to the -FilePath parameter. This would launch anything matching ‘imgburn.exe’ under 'C:\Program Files (x86)"
[quote quote=133740]It will take me some time to digest that code! This is what I got:
And then ImgBurn opened up on my desktop!
Many thanks again, Logan, for your time.
[/quote]
Very glad it launched it for you. If you wanted to see the full paths to the executable you could modify the last scriptblock in the Switch statement to output the fullname property. That would provide the exact path passed to Start-Process that launched the application. That would shed some insight into what was being done incorrectly in the original command when combined with what we now know about strings in PowerShell.