: This, probably, will not work in Windows - you can't delete an EXE file which is running.
This works just fine on Windows 98. Don't know about NT or 2000 since I don't have access to those (and I wouldn't use XP if you paid me).
int main(int argc, char *argv)
struct ffblk finfo;
printf("\nfile name: %s\n", argv);
i = findfirst(argv, &finfo, 0);
i = remove(argv);
printf("\nCan't remove file %s\n", argv);
printf("\nCan't find file %s\n", argv);