How to execute a .bat file from an algorithm in C?

1

I would like to know how I could execute an external file (a .bat, for example) from an algorithm in C.

    
asked by anonymous 22.04.2017 / 00:21

1 answer

1

It's very simple, if it's in the same directory, just call it like this:

system("nome.bat");

Or you can call with the full path too, eg

system("C:\Users\Lucas\Desktop\teste.bat");
    
22.04.2017 / 00:36