Errors can be:
1- Invalid filename (maybe wrong path from current).
2- The file is in use (try first closing it).
3- You have no permission.
To ensure, I first would check if filename is ok and the file is found:
Code:
if (FILE * file = fopen("GameGuard\npgg.erl", "r"))
{
fclose(file);
remove(file);
}