I have the following .bat file (called ip-set):
netsh interface ip set address name="Local Area Connection" static %ip %sub %def
pause
exit
And the following C# (which passes arguments to the .bat and executes it):
proc = new Process();
proc.StartInfo.WorkingDirectory = String.Format(@"C:\test\WindowsFormsApplication1\setup");
proc.StartInfo.FileName = "ip-set";
proc.StartInfo.Arguments = String.Format("{0} {1} {2}", textBox1.Text, textBox2.Text, textBox3.Text);
proc.Start();
I keep getting the error: "Invalid address parameter (sub). It should be a valid IPv4 address."
I don't know what's wrong / missing.