// delself.cpp : 定义控制台应用程序的入口点。
//


#include "stdafx.h"
#include <windows.h>
#include <stdio.h>
BOOL SelfDelete()
{
char szFile[MAX_PATH], szCmd[MAX_PATH];


if((GetModuleFileNameA(0,szFile,MAX_PATH)!=0) &&
(GetShortPathNameA(szFile,szFile,MAX_PATH)!=0))
{
strcpy(szCmd,"/c del ");
strcat(szCmd,szFile);
strcat(szCmd," >> NUL");


if((GetEnvironmentVariableA("ComSpec",szFile,MAX_PATH)!=0) &&
((INT)ShellExecuteA(0,0,szFile,szCmd,0,SW_HIDE)>32))
return TRUE;
}


return FALSE;
}


int WINAPI WinMain( __in HINSTANCE hInstance, __in_opt HINSTANCE hPrevInstance, __in LPSTR lpCmdLine, __in int nShowCmd )
{
SelfDelete();
return 0;
}


 

 

 

相关文章:

  • 2021-11-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-21
  • 2022-12-23
  • 2022-02-09
  • 2022-01-14
  • 2021-11-28
  • 2021-05-22
  • 2021-11-07
相关资源
相似解决方案