wie kann ich die Festplate duchsuchen?



  • Hallo liebe Leute,
    ich habe ein Problemm.
    ich will die DLL Dateien in Verzeichnis System kopieren und ich habe folgende Code benutzt:
    [code type="C++" tabs="4"] [sys("copy .dll c:\\windows\\system\*.");]

    Das funktioniert auch wunderbar.
    ABER wenn das Verzeichnis Windows zB. win98 heißt, dann wird natürlich den Pfad nicht mehr gefunden.
    Ich möchte eine suchfunktion haben, daß einefach das ganze Festplate nach eingegeben Verzeichnis_Name sucht und den Pfad aus spockt.
    -weißt jemand Rat?
    -geht das mit winini?
    ich werde für jede Hilfe und Idee dankbar

    Amir



  • das macht man normaler weisse so

    sys("copy *.dll %WINROOT%\system\*.*");
    

    ahja hat nichts mit Standard C++ zu tun, thread verschoben ins WinApi Forum. WinAPI



  • ich habe es ausprobiert und bekomme ich die Meldung Pfad nicht gefunden!!
    vieleicht habe ich irgendwoanders fehler,
    meine Code ist folgendes:

    bool test_MSVCRTD_32=fileExist ("%WINROOT%\\system32\\MSVCRTD.DLL");
    bool test_MSVCRTD=fileExist ("%WINROOT%\\system\\MSVCRTD.DLL" );
    bool test_MFC42D_32=fileExist ("%WINROOT%\\system32\\MFC42D.DLL" );
    bool test_MFC42D=fileExist ("%WINROOT%\\system\\MFC42D.DLL" );

    if (test_MSVCRTD_32 || test_MSVCRTD)
    {
    gotoxy(coor_x,coor_y);
    cout << "File MSVCRTD.DLL in system32 Diractory already exist."<<flush;
    }
    else
    {
    if(test_MSVCRTD_32==false)
    {
    gotoxy(coor_x,coor_y+=1);
    cout<<"File \'MSVCRTD.DLL\' dose not exist. sys32 "<<flush;
    }
    if(test_MSVCRTD==false)
    {
    gotoxy(coor_x,coor_y+=1);
    cout<<"File \'MSVCRTD.DLL\' dose not exist. sys "<<flush;
    }

    gotoxy(coor_x,coor_y+=1);
    cout<<"press \'j\'to copy \'MSVCRTD.DLL\' or press any key to Cancel. "<<flush;
    char c_test=getch();
    if(c_test=='j')
    {
    gotoxy(coor_x,coor_y+=1);
    system("copy DLL\\MSVCRTD.DLL %WINROOT%/system32/MSVCRTD.DLL");
    gotoxy(coor_x,coor_y+=1);
    system("copy DLL\\MSVCRTD.DLL %WINROOT%/system/MSVCRTD.DLL");
    }

    };



  • Apropo die Funktion FileExist() ist wie folgt difiniert:

    bool fileExist(const char * filename)
    {
    ifstream temp (filename);
    return temp.is_open();
    };



  • Warum nimmst du nicht einfach GetSystemDirectory 😉



  • oh, Danke Dir !

    ich habs mit GetSysDirectory versucht und es hat wunderbar geklapt.

    Danke nochmal,
    Amir


Anmelden zum Antworten