vb.netteamspeak

Start teamspeak and connect to server using vb.net


Normally u can start teamspeak and auto connect to an server using cmd and type "C:\Program Files\TeamSpeak 3 Client\ts3client_win64.exe" "ts3server://my.ip" .

I already tried Process.Start(Chr(34) + "C:\Program Files\TeamSpeak 3 Client\ts3client_win64.exe" + Chr(34) + " " + Chr(34) + "ts3server://my.ip" + Chr(34)) but this doesn't work.

Any ideas how to get it working? Maybe start cmd.exe with it?

I am new to stackoverflow, feel free to comment so I can improve my asking skills.


Solution

  • Process.Start, when called with one argument, tries to start the exact process specified. Since you're passing arguments, it fails to find the file to start it.

    In order to pass arguments, you need to use a different overload, passing the arguments separately:

    Process.Start("C:\Program Files\TeamSpeak 3 Client\ts3client_win64.exe", "ts3server://my.ip")
    

    This also means you don't need to double up on all the quotes as you were doing on the command line.