#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
int main ()
{
int i,j;
puts ("Trying to execute command CD ");
[b] i = system ("cd c:\text"); [/b]
if (i==-1) puts ("Error executing CD");
else puts ("Command successfully executed");
puts ("Trying to execute command del ");
[b] j = system ("del *.txt"); [/b]
if (j==-1) puts ("Error executing del");
else puts ("Command successfully executed");
getchar();
return 0;
}
It won't work. How do I make this go to a specific directory? I know if i just make it i = system ("cd"); that it will print the current directory. Is there a way to change directories this way?