Batch file that takes arguments

Reply

Join Date: Jul 2004
Posts: 4
Reputation: flory is an unknown quantity at this point 
Solved Threads: 0
flory flory is offline Offline
Newbie Poster

Batch file that takes arguments

 
0
  #1
Aug 3rd, 2004
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
Reply With Quote Quick reply to this message  
Join Date: Feb 2004
Posts: 4
Reputation: Ral is an unknown quantity at this point 
Solved Threads: 0
Ral Ral is offline Offline
Newbie Poster

Re: Batch file that takes arguments

 
0
  #2
Aug 3rd, 2004
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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC