Quote:
for an example of what I'm trying to do, is I select one of the commands, for example, "py project -l query" and it runs it through Cmd.exe. When I click the run command button it only runs the first two parts of the command "py project.py" what only loads the python script and doesn't do any of the commands but I need it to run the full command.
When you set us a new StartInfo, it only takes a max of two strings: the first is the filename of the application to run, and the second is all the parameters it needs to work on as a single item.
Split doesn't do that: it break the string on
every occurence oif teh splitting character.
So your input string:
py project -l query
Gets split into four separate strings:
py
project
-l
query
Instead of using split, get the index of the first space, and use Substring:
Dim cmd As String = "py project -l query"
Dim firstSpace As Integer = cmd.IndexOf(" ")
Dim exe As String = cmd.Substring(0, firstSpace)
Dim param As String = cmd.Substring(firstSpace + 1)
And then pass those to your start info:
psi = New ProcessStartInfo(exe, param)