Code
#include <stdio.h>
#include <stdlib.h>
#define BAT_FILE "test.bat"
int main() {
FILE *BatFile;
if(!(BatFile = fopen(BAT_FILE, "r")))
printf("Error open bat file!\n");
char *Command = malloc(sizeof(char) * 256);
while(!feof(BatFile)) {
fgets(Command, 256, BatFile);
system(Command);
}
fclose(BatFile);
free(Command);
}