Click here to Skip to main content
15,891,431 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a VB.NET app that needs to run .bat files to work, and im just wondering if I can make my app run multiple commands when I press a button.

What I have tried:

Making my app run a .bat file from a preset directory
Posted
Updated 29-Jun-20 18:44pm
Comments
Dave Kreskowiak 30-Jun-20 0:11am    
Yes. It's just launching another Process, exactly like you would for running one command. You just launch another one for the next command.

But, you haven't shown the code you've written for launching anything, so it's a bit difficult to tell you anything specific about your implementation.

Also, why would you .BAT files when you can do the same things directly in code?
OakBricks 30-Jun-20 1:59am    
I used .bat files because it's one of my first projects in VB.NET and I think its System.Diagnostics.Start.Process("C:\Folder\bat.bat

1 solution

Private Sub Form1_Click(sender As Object, e As EventArgs) Handles Me.Click
       Process.Start("d:\a.bat")
   End Sub
 
Share this answer
 
Comments
OakBricks 30-Jun-20 14:43pm    
This is what I did to run the .bat files im wondering if I can do this : Process.Start("C:\Path\To\App.exe -Arg XXXX:)
kgmmurugesh 1-Jul-20 0:05am    
Yes, You can run any type of executable files (.bat, .exe, .com etc).

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900