954,505 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Batch file that takes arguments

Hello,all!
Can someone help me Write a batch file that takes 4 arguments and passes them onto your C program. The C program takes each of the arguments and multiplies that argument by 10.

Example of how this is done:

Z:>SAD1.BAT 3 5 7 8

What will be displayed on the screen to the user is the following:

30 50 70 80

flory
Newbie Poster
4 posts since Jul 2004
Reputation Points: 11
Solved Threads: 0
 

When passing an argument into a batch file use %1, %2, %3 and so on inside the batch file.

So your Z:>SAD1.BAT 3 5 7 8

%1 inside the batch file would translate to your number 3 and so forth.

Hope this makes sense.

Ral
Newbie Poster
4 posts since Feb 2004
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You