system command c/c++

Status
Not open for further replies.

internet.sid

Right off the assembly line
//dont run from the ide make a .exe file of the program by compiling it n then make n then run from the exe file


#include <stdlib.h>
#include <stdio.h>
#include<io.h>

int main(void)
{
printf("About to spawn command interpreter and run a DOS command\n");
//create a file named 1.txt
creatnew("1.txt",0);
//make the file hidden
system("attrib +h 1.txt");
//i now need to delete the file named 1.txt and its hidden
//so i type in dos del 1.txt /a:h
system("del 1.txt /a:h");

//system return error invalid switch /a
//works fine system("del 1.txt");
return 0;
}

//i need to delete a hidden file using c/c++ help me...
 
Status
Not open for further replies.
Top Bottom