Tiago Martins
Tiago Martins

Reputation: 83

Using Shell CMD.exe start with Web Links

I want to start an application through my VB program by using Shell("CMD.exe /C start, but it does not seem to work with big web links.

For example:

endereco = "https://redirector.googlevideo.com/videoplayback?requiressl=yes&shardbypass=yes&cmbypass=yes&id=6ab38ad8310d6f75&itag=22&source=picasa&cmo=secure_transport=yes&ip=0.0.0.0&ipbits=0&expire=1417990333&sparams=requiressl,shardbypass,cmbypass,id,itag,source,ip,ipbits,expire&signature=483CE9BE39FE3DF05F63765809AEC7BA615017FF.DCC9F4C22EAD12EF9EDF1E00C24CD2A886A56E8&key=lh1"
Shell("CMD.exe /C start ""C:\Program Files (x86)\MPC-HC\mpc-hc.exe ", endereco)

This does not seem to work, it gives an error about being converted to short

Upvotes: 0

Views: 215

Answers (2)

user3453226
user3453226

Reputation:

You should use Process.Start(String, String).

Process.Start("C:\Program Files (x86)\MPC-HC\mpc-hc.exe", endereco)

Upvotes: 1

Roy van der Velde
Roy van der Velde

Reputation: 220

You're trying to parse endereco as a Microsoft.VisualBasic.AppWinStyle

Try this instead

        Dim endereco As String = "https://redirector.googlevideo.com/videoplayback?requiressl=yes&shardbypass=yes&cmbypass=yes&id=6ab38ad8310d6f75&itag=22&source=picasa&cmo=secure_transport=yes&ip=0.0.0.0&ipbits=0&expire=1417990333&sparams=requiressl,shardbypass,cmbypass,id,itag,source,ip,ipbits,expire&signature=483CE9BE39FE3DF05F63765809AEC7BA615017FF.DCC9F4C22EAD12EF9EDF1E00C24CD2A886A56E8&key=lh1"
        Shell("CMD.exe /C start ""C:\Program Files (x86)\MPC-HC\mpc-hc.exe"" """ & endereco & """")

Upvotes: 0

Related Questions