hannir
hannir

Reputation: 95

How to run BATCH code in VB.NET?

I'd like to run some batch code when click on an button. The thing is I want to create the batch file in VB.NET and not use external batch file.

Finally I want run this batch code - shown in an RichTextBox.

Also - is it possible to change some variables...I mean, for example

$program = "selectedfromlistbox" (in batch.bat)

depends on which "software" was selected in an ListBox.

So I need to paste the ListBox selection into batch.

Hope u understand :) Thx for ur help!

Hannir

Upvotes: 1

Views: 1381

Answers (1)

Thorsten Dittmar
Thorsten Dittmar

Reputation: 56727

You can not run batch code within your application just like that.

You should create a temporary batch file (which then can be customized with values selected in your application) and execute that using the Process class.

Upvotes: 1

Related Questions