I am not quite sure what exactly your batch script does, but it is probably not relevant - I guess you are looking for how to dynamically pass parameters to a batch script from within a C program.
I can show you one way of doing this.
Here is a batch script - takes two arguments
file - the file to copy
folder - the folder to copy to
When copying, the file name is prepended with current time.
I am assuming this script will be saved in file C:/Scripts/CopyFile.txt.
# Script CopyFile.txt
var str file, folder, time
set $time = gettime()
system -s copy /b $file ($folder+"/"+$time+"_"+$file)
Now, here is the C code.
char command ;
// Go to directory where repport file is located.
// Set time to sleep ;
int stime ;
stime = 60*60*1000 ;
// Copy file "rpt.dat" to folder "E:/Copied Reports"
memset(command, 0x00, sizeof(command)) ;
sprintf(command, "C:/biterScripting/biterScripting.exe \"C:/Scripts/CopyFile.txt\" file(\"%s\") folder(\"%s\")",
"E:/Copied Reports") ;
// Sleep for an hour.
The script I wrote above is in biterscripting ( http://www.biterscripting.com ). I used biterscripting because it makes it easier to pass arguments - you don't get into %1 etc. But pure batch script will do also. The above C program will copy file E:/Report/rpt.dat to folder E:/Copied Reports every hour.