943,513 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 53977
  • C RSS
Aug 3rd, 2004
0

Batch file that takes arguments

Expand Post »
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
Similar Threads
Reputation Points: 11
Solved Threads: 0
Newbie Poster
flory is offline Offline
4 posts
since Jul 2004
Aug 3rd, 2004
0

Re: Batch file that takes arguments

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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Ral is offline Offline
4 posts
since Feb 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: Thanks to Junior Techie:rishi
Next Thread in C Forum Timeline: ambigious problem 2nd





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC