🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.csharpbuilder.winforms.general
Article #21

Re: Running a batch in the windows shell with parameters.

#21
From: Marc Rohloff TeamB
Date: Tue, 08 Mar 2005 02:22
23 lines
1981 bytes
On Tue, 8 Mar 2005 01:26:25 +0100, J.A. Smit wrote:

>    {Process myProcess = new Process();
>     string Path="C:\x5cProgram Files\x5cVPN";
>     string UserInfo= textBox1.Text+" "+textBox2.Text;
>     myProcess.StartInfo.FileName = Path + "\x5cVPN.bat " + UserInfo;
>     myProcess.Start();

You need to put the arguments in the Arguments property of the
StartInfo.
ie:
  myProcess.StartInfo.FileName = Path + "\x5cVPN.bat ";
  myProcess.StartInfo.Arguments = UserInfo;


Also there are easier ways (IMO) to set the Path:
   string Path="C:\\Program Files\\VPN";
or
   string Path=@"C:\Program Files\VPN";
   
-- 
Marc Rohloff [TeamB]
marc rohloff -at- myrealbox -dot- com
Technical Details
Message-ID: <161pcwoam9z0o.dlg@marcrohloff.40tude.net>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newsread.com!news-xfer.newsread.com!tdsnet-transit!newspeer.tds.net!gail.ripco.com!news.moat.net!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!news-in.nuthinbutnews.com!news-in.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <422cf130@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 1efeb1,27affd2019062ee
X-Google-Attributes: gid1efeb1,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Marc Rohloff [TeamB]" <"on request">
Subject: Re: Running a batch in the windows shell with parameters.
Newsgroups: borland.public.csharpbuilder.winforms.general
User-Agent: 40tude_Dialog/2.0.15.1
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
References: <422cf130@newsgroups.borland.com>
Date: Mon, 7 Mar 2005 21:22:35 -0500
Message-ID: <161pcwoam9z0o.dlg@marcrohloff.40tude.net>
X-Face: "huzh55Xi]!ZNni78>a*5+).`SK?<^q2MlHk-C]Z2M9T@\J5ZCB$95Ey+s"XQuhGFA[eutZ :0^AV!Q;t>gE`1-=8d;HZ6~*o1dH<X9\b$!|(}+I'!Xq)@3Op}%0ArW&nf'Qh*EwR
X-Antivirus: avast! (VPS 0509-6, 03/07/2005), Outbound message
X-Antivirus-Status: Clean
NNTP-Posting-Host: 4.225.99.49
X-Trace: newsgroups.borland.com 1110248351 4.225.99.49 (7 Mar 2005 18:19:11 -0800)
Lines: 23
X-Authenticated-User: mrohloff
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newsread.com!news-xfer.newsread.com!tdsnet-transit!newspeer.tds.net!gail.ripco.com!news.moat.net!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!news-in.nuthinbutnews.com!news-in.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail