before all the codes and stuff, a little bit of history. i study in a university where the computers are affected by the USB shortcut virus. i think its quite famous in internets and stuff. so i found out the solution to be deleting autorun.inf. however, the folders must be unhidden again, using the command "attrib -r -a -s -h".
in order to simplify these actions, i am coding a C program to automate the process. here's a part of the code
system("cls");
printf("\n\n--------------------------");
printf("\n Attrib -R -A -S -H");
printf("\n--------------------------\n\n");
system("dir * /a:dh /o:n | find \"/\" > temp.txt");
fp=fopen("temp.txt", "r");
while (fgets(read, 100, fp)!=NULL)
{
printf("%s", read);
}
fclose(fp);
printf("\n\nPlease key in the folder name.");
gets(read);
system("attrib -r -a -s -h \"%s\"", read);
printf("\n\nDo you want to continue? (Y for yes, N for no)");
input=_getche();
}
as you'd probably know, the problem persists in the "system("attrib -r -a -s -h \"%s\"", read);". i cannot pass a string to the "system". is there a workaround?