没有Autoexec.bat就放到启动组里或在注册表里写一下好了。

解决方案 »

  1.   

    同意RasWin(封刀客)的看法,而且这是一个非常简单的程序嘛!
    大概30行左右的代码啊!
    呵呵,自己编一下吧!
      

  2.   

    char szTempDir[127];
    ::GetTempPath(127,szTempDir);
    if (strcmp(&szTempDir[strlen(szTempDir)-1],"\\")!=0)
        strcat(szTempDir,"\\");char szFilesToDelete[255];
    wsprintf(szFilesToDelete,"%s*.*",szTempDir);WIN32_FIND_DATA wfd;
    HANDLE hFiles;
    hFiles=::FindFirstFile(szFilesToDelete,&wfd);
    if (hFiles!=INVALID_HANDLE_VALUE)
    {
        char tmp[255];
        wsprintf(tmp,"%s%s",szTempDir,wfd.cFileName);
        DeleteFile(tmp);
        while(::FindNextFile(hFiles,&wfd)!=0)
        {
            wsprintf(tmp,"%s%s",szTempDir,wfd.cFileName);
            DeleteFile(tmp);
        }
    }
      

  3.   

    给你一个函数
    bool DeleteDirectory(char* DirName)
    {
    CFileFind tempFind;
    char tempFileFind[255];
    sprintf(tempFileFind,"%s\\*.*",DirName);
    int IsFinded=tempFind.FindFile(tempFileFind);
    while(IsFinded)
    {
    IsFinded=tempFind.FindNextFile();
    if(!tempFind.IsDots())
    {
    char foundFileName[255];
    strcpy(foundFileName,tempFind.GetFileName().GetBuffer(255));
    if(tempFind.IsDirectory())
    {
    char tempDir[255];
    sprintf(tempDir,"%s\\%s",DirName,foundFileName);
    DeleteDirectory(tempDir);
    }
    else
    {
    char tempFileName[255];
    sprintf(tempFileName,"%s\\%s",DirName,foundFileName);
    DeleteFile(tempFileName);
    }
    }
    }
    tempFind.Close();
    RemoveDirectory(DirName);
    return true;
    }