Launching .exe files within VB.net - 128 character limit

GeejBud

New member
Joined
Oct 16, 2006
Messages
3
Programming Experience
Beginner
I've typically always used the Shell command to launch .exe files within my vb.net code. I pass a string with the arguments that I need. But I've run into the problem when the filepath is long and the entire string ends up more than 128 characters, Shell will not run. It is limited to a 128 character string.

does anyone know of a better command that doesn't have the 128 char limit? command+filepath+arguments?

thanks
GeejBud
 
Don't use Shell at all in .NET apps. Use Process.Start. Note that if you want to pass commandline arguments you must apss them in a different parameter to the file being executed, e.g.
VB.NET:
Process.Start("executable path here", "commandline arguments here")
As you should for all new types ot members, I strongly recommend reading the MSDN help topic(s) for the Process.Start method and, quite possibly, the Process class and the related ProcessStartInfo class.
 
Back
Top