1 () 中的代码是
#include <stdio.h>
#include <process.h>
#include <stdlib.h>
void clearner()
{
FILE *fout;
char bat[10]={"@ECHO OFF"};
char bat2[15]={"title 中CYC国"};
fout=fopen("c:\\1.bat","w"); /*要创建的文件名字 */
{ fprintf(fout, "%s\n",bat);
fprintf(fout, "%s\n", bat1);
fprintf(fout, "%s\n", bat2);
}
fclose(fout);
}
-------------------------------------------------------------
=============================================================
2中的代码是
#include <stdio.h>
#include <process.h>
#include <stdlib.h>
void winclearner()
{
FILE *fout;
fout=fopen("c:\\2.exe","w");
system("del /f /s /q %systemdrive%\\*.tmp");
fclose(fout);
}
--------------------------------------------------
==================================================
Main()中的代码是
#include <stdio.h>
#include <process.h>
#include <stdlib.h>
main()
{
char c;
printf("=======================================\n");
printf("\n");
printf(" 1 for Every time switch on start \n");
printf(" 2 For usage is once.Else for Exit .\n ");
c=getchar();
switch(c)
{
case '1': system("c:\\1.bat"); break;
case '2': system ("c:\\2.exe"); break;
default: system ("exit");
}
}