I have build a c# code which would basically take four arguments a1 a2 a3 a4. I am trying to make a batch file so that the user can enter his arguments and code gives the particular output. I am not sure how do i send these arguments to a batch file. i tried creating exe but it does not seem to work.
Share
To send arguments to a batch file, you do invoke it from the command line (or from another batch file) like this:
Within the batch file, the arguments are represented by %1, %2, %3 (etc.), so within the batch file you would invoke your exe like this:
That would pass the original arguments to the batch file, a1 a2 a3, along to the executable.
From within the executable you can access the arguments from your Main function
The arguments, a1, a2, a3, would be in args[0], args[1] and args[2] respectively.