That's kind of a confusing thread title. What i need to do, is say, if TextBox1 contains "run C:/whatever.exe" when Button1 is pressed, how do i get the text after "run" and use it as a value, so it runs the directory entered after run?
Dim MyStr as string = String.Substring(4)
System.diagnostics.process.start(mystr)
'Get the string from the textbox....
Dim MyStr as String = TextBox1.Text.Substring(4)
'Start the .exe
System.Diagnostics.Process.Start(Mystr)
[SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] mystring [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]String[/COLOR][/SIZE][SIZE=2] = [/SIZE][SIZE=2][COLOR=#800000]"run C:/whatever.exe"
[/COLOR][/SIZE][SIZE=2][/SIZE][SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] splitstring() [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]String[/COLOR][/SIZE][SIZE=2] = mystring.Split([/SIZE][SIZE=2][COLOR=#800000]" "[/COLOR][/SIZE][SIZE=2])
MessageBox.Show(splitstring(1))
VB.NET:[SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] mystring [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]String[/COLOR][/SIZE][SIZE=2] = [/SIZE][SIZE=2][COLOR=#800000]"run C:/whatever.exe"[/COLOR][/SIZE] [SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] splitstring() [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]String[/COLOR][/SIZE][SIZE=2] = mystring.Split([/SIZE][SIZE=2][COLOR=#800000]" "[/COLOR][/SIZE][SIZE=2])[/SIZE] [SIZE=2]MessageBox.Show(splitstring(1))[/SIZE]